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; +unlinkFarcasterAccount: () => Promise; +findUserIdentities: (userIDs: $ReadOnlyArray) => Promise; - // We are introducing this on web temporarily to make sure the identity - // service is reachable in production - +ping?: () => Promise; + +versionSupported: () => Promise; } 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 = async () => { + versionSupported: () => Promise = 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]);