Page MenuHomePhabricator

[native] Make SecureStore methods static
ClosedPublic

Authored by michal on Nov 17 2023, 8:45 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 4, 12:07 PM
Unknown Object (File)
Nov 15 2024, 7:05 AM
Unknown Object (File)
Nov 3 2024, 11:23 AM
Unknown Object (File)
Nov 1 2024, 9:47 PM
Unknown Object (File)
Oct 25 2024, 5:51 PM
Unknown Object (File)
Oct 13 2024, 1:09 AM
Unknown Object (File)
Oct 13 2024, 1:09 AM
Unknown Object (File)
Oct 13 2024, 1:09 AM
Subscribers

Details

Summary

ENG-1567

This will make it easier to expose SecureStore to Rust as our native Rust codebase as inherently stateless.

Test Plan

Tested on Android and iOS physical devices:

  • Add log to SQLiteQueryExecutor::initilize that prints maybeEncryptionKey read from Secure Store
  • Open the app -> encryption key is logged
  • Log out and log in to trigger creation of a new encryption key
  • Restart the app -> a different encryption key is logged

Tested notifications on physical devices:

  • Send notification - ensure it is displayed correctly.
  • Send notification to backgrounded app, kill keyserver in the terminal and open the app. Ensure that data delivered with notification are present even though the keyserver is not running.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

native/cpp/CommonCpp/Tools/CommSecureStore.h
13–15 ↗(On Diff #33387)

This needs to be inline because each variable can only be defined once. In case of instance variables this can be done in a header file (as each instance has a "separate" variable). In case of static variables their values normally would be specified in the .cpp files which is problematic for us as we have a separate implementations for iOS and Android. Fortunately we can use C++17 feature and mark them as inline which allows us the specify value in the header file.

C++ reference, section "Static data members"

Test plan should include an additional steps that ensure notifications functionality is not broken by those changes:

  1. Send notification - ensure it is displayed correctly.
  2. Send notification to backgrounded app, kill keyserver in the terminal and open the app. Ensure that data delivered with notification are present even though the keyserver is not running.
This revision is now accepted and ready to land.Nov 20 2023, 2:17 AM