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)
Apr 9 2024, 1:24 AM
Unknown Object (File)
Apr 9 2024, 1:24 AM
Unknown Object (File)
Apr 9 2024, 1:23 AM
Unknown Object (File)
Apr 9 2024, 1:23 AM
Unknown Object (File)
Apr 7 2024, 8:17 AM
Unknown Object (File)
Mar 27 2024, 5:35 AM
Unknown Object (File)
Mar 25 2024, 11:58 AM
Unknown Object (File)
Mar 17 2024, 2:58 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
Lint Not Applicable
Unit
Tests Not Applicable

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.