Page MenuHomePhabricator

[native] add versionSupported method to CommRustModule
ClosedPublic

Authored by varun on Nov 9 2023, 2:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 3, 2:55 AM
Unknown Object (File)
Sat, Oct 12, 3:34 PM
Unknown Object (File)
Sat, Oct 12, 3:34 PM
Unknown Object (File)
Sat, Oct 12, 3:33 PM
Unknown Object (File)
Sat, Oct 12, 3:28 PM
Unknown Object (File)
Sep 7 2024, 1:17 AM
Unknown Object (File)
Sep 1 2024, 9:32 AM
Unknown Object (File)
Aug 29 2024, 5:17 PM
Subscribers

Details

Summary

This method calls the identity service's ping RPC and parses the response to determine if the client code version is supported. This method will be used in a React component to tell users to upgrade unsupported clients.

Depends on D9812

Test Plan
diff --git a/native/data/sqlite-data-handler.js b/native/data/sqlite-data-handler.js
index 50bbaa8b8..aa9f16d34 100644
--- a/native/data/sqlite-data-handler.js
+++ b/native/data/sqlite-data-handler.js
@@ -22,7 +22,7 @@ import { getMessageForException } from 'lib/utils/errors.js';
 import { ashoatKeyserverID } from 'lib/utils/validation-utils.js';
 
 import { filesystemMediaCache } from '../media/media-cache.js';
-import { commCoreModule } from '../native-modules.js';
+import { commCoreModule, commRustModule } from '../native-modules.js';
 import { setStoreLoadedActionType } from '../redux/action-types.js';
 import { useSelector } from '../redux/redux-utils.js';
 import { StaffContext } from '../staff/staff-context.js';
@@ -32,6 +32,9 @@ import { isTaskCancelledError } from '../utils/error-handling.js';
 import { useStaffCanSee } from '../utils/staff-utils.js';
 
 async function clearSensitiveData() {
+  const versionSupported = await commRustModule.versionSupported();
+  Alert.alert('version supported: ' + versionSupported);
+
   await commCoreModule.clearSensitiveData();
   try {
     await filesystemMediaCache.clearCache();
  1. got back true in the alert
  2. hardcoded ping RPC to return a version unsupported error and got back false in the alert

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable