Page MenuHomePhabricator

[native] Stop backup client in background
ClosedPublic

Authored by michal on Feb 14 2024, 6:26 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 6, 5:09 PM
Unknown Object (File)
Oct 15 2024, 12:01 PM
Unknown Object (File)
Oct 15 2024, 12:01 PM
Unknown Object (File)
Oct 15 2024, 12:00 PM
Unknown Object (File)
Oct 15 2024, 12:00 PM
Unknown Object (File)
Oct 7 2024, 8:22 AM
Unknown Object (File)
Sep 4 2024, 7:30 AM
Unknown Object (File)
Sep 4 2024, 7:30 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