Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Come up with solution for resetting/restarting collection when config changes #105

Open
shankari opened this issue Mar 28, 2016 · 0 comments

Comments

@shankari
Copy link
Contributor

Right now, we can only reconfigure through the UI, so I can add a plugin method to restart the data collection - albeit in a somewhat hacky way. But later, we may get configs that are pushed from the server. We need to be able to restart the collection in that case, but also we don't want to restart for every config push because nothing might have changed.

Some form of versioning might be useful, and will also solve the race with rw-documents from e-mission/cordova-server-sync#12

We should also come up with a less hacky version of restarting data collection!?

shankari added a commit to shankari/e-mission-data-collection that referenced this issue Mar 28, 2016
We already had support for turning tracking off, but then we just went back to
the start state. That is not a good solution because in order to make the
normal case more robust, we re-send the initialize transition if we are in the
start state.

So now, when we turn tracking off, we go to a different state
`tracking_stopped`, and the only way to get out of it is to recieve a new
`start_tracking` transition.

Also:
- refactored the plugin interface code to force general transitions instead of
  expanding the existing hardcoded list.
- ensured that the state machine is reset when the config changes through UI
  input by turning tracking on and off

The second of these is a workaround, not a real solution, since it doesn't deal
with automatic updates from the server that could come in as part of the sync,
and it is not clear that stopping and restarting tracking (or at least, doing
so in the current, hacky way) is the best way to reset.

Long-term solution is tracked at:
e-mission#105
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant