Closed
Bug 1262021
Opened 9 years ago
Closed 9 years ago
Remote commands are applied on every Sync
Categories
(Firefox :: Sync, defect, P1)
Firefox
Sync
Tracking
()
RESOLVED
FIXED
Firefox 48
Tracking | Status | |
---|---|---|
firefox48 | --- | fixed |
People
(Reporter: markh, Assigned: lina)
References
Details
(Whiteboard: [sync-data-integrity])
Attachments
(1 file)
In bug 1250531, we failed to take into account that we don't immediately re-upload the local record after applying the commands, so when we do the next Sync we re-apply the commands on the server. The end result is that commands are applied each sync - which is bad :(
Kit and I have a fix for this that should be ready tomorrow.
Assignee | ||
Comment 1•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/44247/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/44247/
Attachment #8738008 -
Flags: review?(markh)
Assignee | ||
Comment 2•9 years ago
|
||
https://reviewboard.mozilla.org/r/44247/#review40911
::: services/sync/tests/unit/test_clients_engine.js:847
(Diff revision 1)
> server.stop(run_next_test);
> }
> }
> });
>
> +add_test(function test_send_uri_ack() {
Unfortunately, the preceding test is now failing for me locally, with an `NS_ERROR_CONNECTION_REFUSED`. I'm wondering if there's a bit of state we're not cleaning up somewhere, or the runs are stomping on one another.
Assignee | ||
Comment 6•9 years ago
|
||
Comment on attachment 8738008 [details]
MozReview Request: Bug 1262021 - Ensure remote commands are applied once per sync. r?markh
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/44247/diff/1-2/
Assignee | ||
Comment 7•9 years ago
|
||
The most recent revision, which clobbers the cache in `test_receive_display_uri`, fixed the failure locally.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=9e40e965425c
Assignee | ||
Updated•9 years ago
|
Status: NEW → ASSIGNED
Flags: firefox-backlog+
Priority: -- → P1
Reporter | ||
Comment 8•9 years ago
|
||
Comment on attachment 8738008 [details]
MozReview Request: Bug 1262021 - Ensure remote commands are applied once per sync. r?markh
https://reviewboard.mozilla.org/r/44247/#review41093
Attachment #8738008 -
Flags: review?(markh) → review+
Assignee | ||
Comment 9•9 years ago
|
||
Comment on attachment 8738008 [details]
MozReview Request: Bug 1262021 - Ensure remote commands are applied once per sync. r?markh
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/44247/diff/2-3/
Attachment #8738008 -
Attachment description: MozReview Request: Bug 1262021 - Ensure remote commands are applied once per sync. r?markh → MozReview Request: Bug 1262021 - Ensure remote commands are applied once per sync. r=markh
Assignee | ||
Comment 10•9 years ago
|
||
Comment on attachment 8738008 [details]
MozReview Request: Bug 1262021 - Ensure remote commands are applied once per sync. r?markh
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/44247/diff/3-4/
Attachment #8738008 -
Attachment description: MozReview Request: Bug 1262021 - Ensure remote commands are applied once per sync. r=markh → MozReview Request: Bug 1262021 - Ensure remote commands are applied once per sync. r?markh
Assignee | ||
Updated•9 years ago
|
Attachment #8738008 -
Flags: review+ → review?(markh)
Assignee | ||
Comment 11•9 years ago
|
||
https://reviewboard.mozilla.org/r/44247/#review41143
::: services/sync/modules/engines/clients.js:29
(Diff revision 4)
> const CLIENTS_TTL_REFRESH = 604800; // 7 days
>
> const SUPPORTED_PROTOCOL_VERSIONS = ["1.1", "1.5"];
>
> function hasDupeCommand(commands, action) {
> + if (!commands) {
For the case where there aren't any local or remote commands, if the recipient removed them.
::: services/sync/modules/engines/clients.js:512
(Diff revision 4)
> - this.engine.localCommands = record.commands;
> - else {
> + },
> +
> + _updateRemoteRecord(record) {
> - let currentRecord = this._remoteClients[record.id];
> + let currentRecord = this._remoteClients[record.id];
> - if (currentRecord && currentRecord.commands) {
> - // Merge commands.
> + if (!currentRecord || !currentRecord.commands ||
> + !this.engine.isLocallyModified(record.id)) {
This is the relevant change to avoid reuploading commands that a remote client has received and deleted. If we haven't modified it, we just accept the server's data as canonical.
Reporter | ||
Comment 12•9 years ago
|
||
Comment on attachment 8738008 [details]
MozReview Request: Bug 1262021 - Ensure remote commands are applied once per sync. r?markh
https://reviewboard.mozilla.org/r/44247/#review41203
::: services/sync/modules/engines.js:1259
(Diff revision 4)
> this._delete.ids = [id];
> else
> this._delete.ids.push(id);
> },
>
> + isLocallyModified(id) {
as discussed, let's keep inlining this given it is only true during a sync (othertimes we'd need to check the tracker)
::: services/sync/tests/unit/test_clients_engine.js:886
(Diff revision 4)
> + args: ["https://example.com", fakeSenderID, "Yak Herders Anonymous"],
> + }];
> + server.insertWBO("foo", "clients", new ServerWBO(engine.localID, encryptPayload(ourPayload), now));
> +
> + _("Sync again");
> + engine.lastSync = now - 10;
I think we should remove this given it's no longer needed (and if it *is* still needed, we are probably missing something else and need to dig deeper)
Attachment #8738008 -
Flags: review?(markh) → review+
Comment 14•9 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox48:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 48
Updated•8 years ago
|
Whiteboard: [sync-data-integrity]
You need to log in
before you can comment on or make changes to this bug.
Description
•