Page MenuHomePhabricator

[lib] Dispatch processNewUserIDsActionType
AcceptedPublic

Authored by inka on Thu, Jun 6, 3:49 AM.
Tags
None
Referenced Files
F2086141: D12329.id41035.diff
Sun, Jun 23, 12:10 PM
Unknown Object (File)
Thu, Jun 20, 9:00 AM
Unknown Object (File)
Tue, Jun 18, 5:26 PM
Unknown Object (File)
Sun, Jun 16, 10:41 PM
Unknown Object (File)
Fri, Jun 14, 8:03 AM
Unknown Object (File)
Fri, Jun 14, 6:44 AM
Unknown Object (File)
Fri, Jun 14, 5:20 AM
Unknown Object (File)
Wed, Jun 12, 2:43 PM
Subscribers

Details

Reviewers
tomek
kamil
Summary

issue: [[https://linear.app/comm/issue/ENG-8190/[inka][june]-userstore-syncing-stop-processing-data-from-secondary | ENG-8190]]
After extracting user ids from server message we want to dispatch processNewUserIDsActionType to create entries for these ids in the user store. Then, UserInfosHandler will fetch missing user infos.

Test Plan

Tested that the action is dispatched both for socket messages and http api responses

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

inka requested review of this revision.Thu, Jun 6, 4:05 AM
tomek added inline comments.
lib/socket/user-infos-handler.react.js
14–35 ↗(On Diff #41035)

Up to you, but we can useDispatch() here instead of passing the value as a prop

This revision is now accepted and ready to land.Thu, Jun 6, 4:18 AM
inka planned changes to this revision.Thu, Jun 6, 5:03 AM

Actually I should avoid dispatching the action if userIDs is empty. This results in a lot of unnecessary actions, mostly from PONG message

Stop dispatching if array empty

This revision is now accepted and ready to land.Thu, Jun 6, 5:08 AM
lib/socket/user-infos-handler.react.js
14–35 ↗(On Diff #41035)

Personally I think this would be cleaner