Page MenuHomePhorge

D12405.1767160078.diff
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

D12405.1767160078.diff

diff --git a/lib/types/identity-service-types.js b/lib/types/identity-service-types.js
--- a/lib/types/identity-service-types.js
+++ b/lib/types/identity-service-types.js
@@ -195,9 +195,7 @@
+linkFarcasterAccount: (farcasterID: string) => Promise<void>;
+unlinkFarcasterAccount: () => Promise<void>;
+findUserIdentities: (userIDs: $ReadOnlyArray<string>) => Promise<Identities>;
- // We are introducing this on web temporarily to make sure the identity
- // service is reachable in production
- +ping?: () => Promise<void>;
+ +versionSupported: () => Promise<boolean>;
}
export type IdentityServiceAuthLayer = {
diff --git a/native/identity-service/identity-service-context-provider.react.js b/native/identity-service/identity-service-context-provider.react.js
--- a/native/identity-service/identity-service-context-provider.react.js
+++ b/native/identity-service/identity-service-context-provider.react.js
@@ -696,6 +696,9 @@
const identities = JSON.parse(result);
return assertWithValidator(identities, identitiesValidator);
},
+ versionSupported: () => {
+ return commRustModule.versionSupported();
+ },
}),
[getAuthMetadata],
);
diff --git a/web/components/identity-ping.react.js b/web/components/identity-ping.react.js
--- a/web/components/identity-ping.react.js
+++ b/web/components/identity-ping.react.js
@@ -16,7 +16,7 @@
return;
}
const identityClient = identityContext.identityClient;
- const pingCall = identityClient.ping;
+ const pingCall = identityClient.versionSupported;
if (!pingCall) {
console.log('Ping method unimplemented');
return;
diff --git a/web/grpc/identity-service-client-wrapper.js b/web/grpc/identity-service-client-wrapper.js
--- a/web/grpc/identity-service-client-wrapper.js
+++ b/web/grpc/identity-service-client-wrapper.js
@@ -668,9 +668,17 @@
return assertWithValidator(identities, identitiesValidator);
};
- ping: () => Promise<void> = async () => {
+ versionSupported: () => Promise<boolean> = async () => {
const client = this.unauthClient;
- await client.ping(new Empty());
+ try {
+ await client.ping(new Empty());
+ return true;
+ } catch (e) {
+ if (getMessageForException(e) === 'unsupported_version') {
+ return false;
+ }
+ throw e;
+ }
};
}
diff --git a/web/grpc/identity-service-context-provider.react.js b/web/grpc/identity-service-context-provider.react.js
--- a/web/grpc/identity-service-context-provider.react.js
+++ b/web/grpc/identity-service-context-provider.react.js
@@ -139,7 +139,7 @@
linkFarcasterAccount: proxyMethodToWorker('linkFarcasterAccount'),
unlinkFarcasterAccount: proxyMethodToWorker('unlinkFarcasterAccount'),
findUserIdentities: proxyMethodToWorker('findUserIdentities'),
- ping: proxyMethodToWorker('ping'),
+ versionSupported: proxyMethodToWorker('versionSupported'),
};
}, [proxyMethodToWorker]);

File Metadata

Mime Type
text/plain
Expires
Wed, Dec 31, 5:47 AM (17 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5872310
Default Alt Text
D12405.1767160078.diff (2 KB)

Event Timeline