Page MenuHomePhabricator

Implement JSI to handle unread count from JS
ClosedPublic

Authored by marcin on Feb 14 2024, 4:25 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 23, 8:48 AM
Unknown Object (File)
Sat, Nov 23, 5:51 AM
Unknown Object (File)
Fri, Nov 22, 9:46 PM
Unknown Object (File)
Fri, Nov 22, 4:42 AM
Unknown Object (File)
Fri, Nov 22, 12:29 AM
Unknown Object (File)
Thu, Nov 21, 5:28 AM
Unknown Object (File)
Wed, Nov 6, 4:43 PM
Unknown Object (File)
Oct 27 2024, 3:19 AM
Subscribers

Details

Summary

This differential implements two JSI calls that can update unread counts for keyservers in MMKV and remove keyservers from MMKV.

Test Plan
  1. Apply this patch to the code: https://gist.github.com/marcinwasowicz/72f1a3ca842f9ad5e92c59dec67b7eda. This patch adds changes that use those two JSI in a "dirty" way in JS and that query MMKV for keyserver unread counts from NSE.
  2. Build the app and keep it in foreground.
  3. Open web app on the same client and keep marking threads as read and unread. Ensure that logs in Android studio/MacOS console app contain correct values for unread counts.
  4. Background the app and repeat step 3. Ensure that logs in Android studio/MacOS console app contain the last value logged in step 4. This is expected - JS doesn't update MMKV in the background.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

tomek added inline comments.
native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
867 ↗(On Diff #37065)

How about keyserverUnreadCountKey?

This revision is now accepted and ready to land.Feb 14 2024, 9:04 AM

Rebase to restructure stack

Add function to get unread counts for a set of keyservers

Fix compilation error - forgot to add std::move when resolving jsi::Array.