From ef15fb4e402cd904f9ad5c7afacc150737268d58 Mon Sep 17 00:00:00 2001 From: xsanm Date: Mon, 27 Nov 2023 18:15:24 +0100 Subject: [PATCH] [lib] update `currentAsOf` for SIWE auth Summary: Updating this to have correct [type](https://github.com/CommE2E/comm/blob/4737cce6f2e643073bfe27ab42f8cc7bab12593f/lib/types/message-types.js#L647). This partially caused [ENG-5883](https://linear.app/comm/issue/ENG-5883/rahul-sees-socket-crash-loop-due-to-policy-acceptance-issue). We were returning `0` as the default value for `currentAsOf` in here: [link](https://github.com/CommE2E/comm/blob/371f6f808e5e8c44fb4b175081b0b1624225ff55/lib/selectors/keyserver-selectors.js#L57). This later caused a condition from D9965 truthy right after login. Test Plan: 1. Log `currentAsOf` 2. Log in using SIWE 3. Make sure it has correct type and value (previously it was number, not object). Reviewers: inka, tomek, michal, ashoat Reviewed By: ashoat Subscribers: ashoat Differential Revision: https://phab.comm.dev/D10058 --- lib/actions/siwe-actions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/actions/siwe-actions.js b/lib/actions/siwe-actions.js index 595f4c13ff..3ed701b779 100644 --- a/lib/actions/siwe-actions.js +++ b/lib/actions/siwe-actions.js @@ -72,7 +72,7 @@ const siweAuth = messageInfos: response.rawMessageInfos, truncationStatus: response.truncationStatuses, watchedIDsAtRequestTime: watchedIDs, - currentAsOf: response.serverTime, + currentAsOf: { [ashoatKeyserverID]: response.serverTime }, }, userInfos, updatesCurrentAsOf: response.serverTime,