This repository was archived by the owner on Oct 18, 2018. It is now read-only.
Bug 815773 - process local commands#276
Open
ncalexan wants to merge 3 commits into
Open
Conversation
…cessor singleton initialization. As CommandProcessor states, there are two times when we need the processor: to execute commands during a sync, and to store commands in response to local user action. CommandProcessor refuses to send commands that have not been previously registered (probably the right choice) and therefore we need to register all commands that we might receive *and that we might send*. Therefore, we move command registration into the CommandProcessor initialization. This tightly couples CommandProcessor and GlobalSession, which is unfortunate, but could be revisited later.
…mmands. It is possible that there are commands in the database for the local GUID that did not come from the server, namely locally triggered "wipeAll", "resetAll", commands. We should process them!
… configurable, and add test for processLocalRecords.
Contributor
There was a problem hiding this comment.
Making this non-final means that it's possible for registered commands to get lost. You need to define under what circumstances this processor is released, and when commands should register with a new one.
Contributor
|
Do you have a new version of this, Nick? |
Contributor
Author
|
No updated version yet. Your suggestions are good but make this significantly more work ;) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is just the base stuff to process local commands. (local commands == commands generated by local actions, such as from Sync > Options).
There's UI work to be done on top of this, but we may as well look over this first.
The key point is that local commands are processed when the clients engine downloads its local GUID; that means there's a race if you haven't yet synced.
Braindump 1: there could be interactions if you reset your local GUID that I haven't considered.
Braindump 2: I should verify that local commands are deleted from the DB after processing. I think I did this, but I should verify. This probably needs to wait until UI is in place.