Page MenuHomePhabricator

[native] Stop backup client in background
ClosedPublic

Authored by michal on Feb 14 2024, 6:26 AM.
Tags
None
Referenced Files
F2146785: D11074.id.diff
Sun, Jun 30, 12:24 AM
Unknown Object (File)
Tue, Jun 25, 6:39 AM
Unknown Object (File)
Tue, Jun 25, 2:42 AM
Unknown Object (File)
Tue, Jun 25, 12:58 AM
Unknown Object (File)
Tue, Jun 25, 12:12 AM
Unknown Object (File)
Tue, Jun 25, 12:00 AM
Unknown Object (File)
Sat, Jun 22, 8:45 PM
Unknown Object (File)
Thu, Jun 13, 12:26 AM
Subscribers

Details

Summary

ENG-6215

Improve the backup client upload handler lifecycle. We want to close it when we go into the background and open when the app is foregrounded.

Depends on D11044

Test Plan
  • Enable upload handler
  • Observe logs in the backup service to see when the socket is opened/closed
  • Make sure that when the app is backgrounded the socket is closed (gracefully and not because of a timeout)
  • Make sure that when the app is foregrounded the socket is opened (without waiting for some accidental re-render)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

michal published this revision for review.Feb 14 2024, 6:43 AM
This revision is now accepted and ready to land.Feb 19 2024, 4:39 AM
kamil requested changes to this revision.Feb 21 2024, 5:02 AM

One question

native/backup/backup-handler.js
22 ↗(On Diff #37074)

what about inactive?

This revision now requires changes to proceed.Feb 21 2024, 5:02 AM
native/backup/backup-handler.js
22 ↗(On Diff #37074)

I've talked about this with @marcin and we came to the conclusion that the state that really matters is the background state. This is the state we really need to kill all resources the app uses, the inactive type happens more often, and I think we would still want to upload the logs if the user just swipes the app up for a moment.
We also do the same for the keyserver socket.

kamil added inline comments.
native/backup/backup-handler.js
22 ↗(On Diff #37074)

makes sense - thanks

This revision is now accepted and ready to land.Feb 23 2024, 2:48 AM