Page MenuHomePhabricator

[lib] Extract user ids from server socket messages
ClosedPublic

Authored by inka on May 15 2024, 7:42 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jun 23, 4:17 AM
Unknown Object (File)
Sun, Jun 23, 4:17 AM
Unknown Object (File)
Wed, Jun 19, 4:07 PM
Unknown Object (File)
Wed, Jun 19, 9:48 AM
Unknown Object (File)
Wed, Jun 19, 9:11 AM
Unknown Object (File)
Tue, Jun 18, 10:05 PM
Unknown Object (File)
Sat, Jun 15, 9:15 AM
Unknown Object (File)
Wed, Jun 12, 12:57 AM
Subscribers

Details

Summary

issue: ENG-7742
This handler extracts user ids from server messages that come over the socket.

Test Plan

Sent a message from user1 and checked that updates/server messages on user2 are parsed correctly - correct user ids are extracted.
Tested that no errors show up

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

inka requested review of this revision.May 15 2024, 7:58 AM
lib/socket/user-infos-handler.react.js
1 ↗(On Diff #40222)

Nit: newline below Flow declaration

3 ↗(On Diff #40222)

We usually type React.useEffect directly

5–9 ↗(On Diff #40222)

Merge imports

17 ↗(On Diff #40222)

Would it be good to rename this to be clear it only handles UserInfos that come in through the socket?

tomek added inline comments.
lib/socket/user-infos-handler.react.js
13–14 ↗(On Diff #40222)

It's more convenient to type these as returning mixed

This revision is now accepted and ready to land.May 16 2024, 1:20 AM
lib/socket/socket.react.js
15 ↗(On Diff #40278)

I think it's best to use SocketMessageUserInfosHandler here too

lib/socket/user-infos-handler.react.js
20 ↗(On Diff #40278)

I'd move this lower, next to where they're used