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)
Mon, Jun 24, 7:25 AM
Unknown Object (File)
Mon, Jun 24, 7:25 AM
Unknown Object (File)
Mon, Jun 24, 7:24 AM
Unknown Object (File)
Mon, Jun 24, 7:10 AM
Unknown Object (File)
Wed, Jun 19, 9:46 PM
Unknown Object (File)
Wed, Jun 19, 9:46 PM
Unknown Object (File)
Wed, Jun 12, 12:35 PM
Unknown Object (File)
Tue, Jun 11, 1:15 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