Page MenuHomePhabricator

[lib] Extract user ids from server socket messages
AcceptedPublic

Authored by inka on Wed, May 15, 7:42 AM.
Tags
None
Referenced Files
F1787149: D12052.id40222.diff
Sat, May 18, 8:24 PM
F1787148: D12052.id40278.diff
Sat, May 18, 8:24 PM
F1787120: D12052.id.diff
Sat, May 18, 8:23 PM
F1787113: D12052.diff
Sat, May 18, 8:21 PM
Subscribers

Details

Reviewers
tomek
kamil
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
Branch
inka/userStore
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

inka requested review of this revision.Wed, May 15, 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.Thu, May 16, 1:20 AM
lib/socket/socket.react.js
15

I think it's best to use SocketMessageUserInfosHandler here too

lib/socket/user-infos-handler.react.js
20

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