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

Expose API to stop syncing when app goes into background #576

Closed
EvanHahn opened this issue Apr 18, 2024 · 0 comments · Fixed by #611
Closed

Expose API to stop syncing when app goes into background #576

EvanHahn opened this issue Apr 18, 2024 · 0 comments · Fixed by #611
Assignees
Labels
mvp Requirement for MVP

Comments

@EvanHahn
Copy link
Contributor

EvanHahn commented Apr 18, 2024

When CoMapeo goes into the background, we should gracefully shut down sync.

For this task, that means the following:

  1. Add a function like shutdownSync1, which the frontend will call when the app goes into the background.
  2. Close the local discovery TCP listener (probably means calling LocalDiscovery.prototype.#stop)
  3. For each open connection...
    1. Stop replicating (similar to blocked) if they haven't started replicating back.
    2. Wait until sync completes. (Likely requires no waiting because the app usually isn't syncing when the app goes into the background.)
    3. Close the connection.

Footnotes

  1. Come up with a better name if you can! Please!!

@EvanHahn EvanHahn added the mvp Requirement for MVP label Apr 18, 2024
@EvanHahn EvanHahn self-assigned this Apr 24, 2024
EvanHahn added a commit that referenced this issue May 6, 2024
`MapeoManager#onBackgrounded()` should be called when the app goes into
the background. It will do its best to gracefully shut down sync.

Closes [#576].

[#576]: #576
EvanHahn added a commit that referenced this issue May 27, 2024
`MapeoManager#onBackgrounded()` should be called when the app goes into
the background. It will do its best to gracefully shut down sync.

Closes [#576].

[#576]: #576

Co-authored-by: Gregor MacLennan <gmaclennan@digital-democracy.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mvp Requirement for MVP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant