Page MenuHomePhabricator

Send all notifications received by backgrounded app to JS at once
ClosedPublic

Authored by marcin on Oct 9 2023, 9:19 AM.
Tags
None
Referenced Files
F2775012: D9429.diff
Fri, Sep 20, 3:53 AM
Unknown Object (File)
Sun, Sep 15, 1:15 PM
Unknown Object (File)
Sun, Sep 15, 1:15 PM
Unknown Object (File)
Sun, Sep 15, 1:15 PM
Unknown Object (File)
Sun, Sep 15, 1:15 PM
Unknown Object (File)
Sun, Sep 15, 1:13 PM
Unknown Object (File)
Sun, Sep 15, 12:53 PM
Unknown Object (File)
Wed, Sep 11, 10:45 PM
Subscribers

Details

Summary

Previously for each notification received by backgrounded app we sent separate JS event so that it could be persisted in redux and SQLite. However there was
no reason not to send one JS event with array of all messages. It can potentially help the issue:
https://linear.app/comm/issue/ENG-5147/messageinfos-from-notifs-take-too-long-to-import-on-ios-start#comment-a2fb0774

Test Plan
  1. Build iOS app.
  2. Background it.
  3. Send multiple messages.
  4. Kill the keyserver.
  5. Bring the app to the foreground again.
  6. Ensure all messages are available in the relevant thread(s) even the keyserver is not running.

Diff Detail

Repository
rCOMM Comm
Branch
marcin/eng-5147
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

marcin requested review of this revision.Oct 9 2023, 9:37 AM

Looks good to me but letting others review as well

native/push/push-handler.react.js
548–550

This should also work

tomek added inline comments.
native/push/ios.js
85

Is it really optional?

This revision is now accepted and ready to land.Oct 10 2023, 4:23 AM
  1. Make messageInfosArray not optional since it is actually not
  2. Use flatMap

Ensure in Objective-C code that messageInfosArray is not optional.