Page MenuHomePhabricator

[keyserver] Transform client IDs when handling socket message
ClosedPublic

Authored by tomek on Mar 5 2024, 4:41 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 24, 10:28 PM
Unknown Object (File)
Fri, Jun 21, 11:26 AM
Unknown Object (File)
Thu, Jun 20, 3:33 PM
Unknown Object (File)
Tue, Jun 18, 2:44 AM
Unknown Object (File)
Tue, Jun 18, 2:44 AM
Unknown Object (File)
Tue, Jun 18, 2:06 AM
Unknown Object (File)
May 12 2024, 11:31 PM
Unknown Object (File)
Apr 7 2024, 8:16 PM
Subscribers

Details

Summary

When receiving a socket message, the server wasn't transforming the IDs - it caused verifyCalendarQueryThreadIDs to throw because none of the received thread filter IDs were present in the DB.

https://linear.app/comm/issue/ENG-7115/changing-calendar-query-doesnt-work

Test Plan

Add and remove some thread filters and check if the error message no longer occurs. Also check if the actualizedCalendarQuery is correctly updated in the store.

Diff Detail

Repository
rCOMM Comm
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

tomek requested review of this revision.Mar 5 2024, 5:04 AM
keyserver/src/socket/socket.js
247

Just making sure: if the socket message is an API request we won't try to convert the message twice (this would cause errors/warnings)?

keyserver/src/socket/socket.js
247

We will convert the message twice, and this is intentional. One of the message types we can receive is clientSocketMessageTypes.API_REQUEST which goes to our jsonEndpoints. This is fine, and doesn't cause repeated ID conversion because APIRequestClientSocketMessage contains APIRequest which has input?: Object (t.maybe(t.Object)) - so even if the input contains some IDs, we won't attempt their conversion yet.

This revision is now accepted and ready to land.Mar 5 2024, 6:03 AM