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)
Sun, Nov 24, 7:52 AM
Unknown Object (File)
Sun, Nov 24, 7:37 AM
Unknown Object (File)
Sun, Nov 24, 5:35 AM
Unknown Object (File)
Sat, Nov 16, 5:45 PM
Unknown Object (File)
Sat, Nov 16, 5:45 PM
Unknown Object (File)
Sat, Nov 16, 5:45 PM
Unknown Object (File)
Sat, Nov 16, 5:45 PM
Unknown Object (File)
Oct 14 2024, 9:46 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