Page MenuHomePhabricator

[lib] Dispatch processNewUserIDsActionType
ClosedPublic

Authored by inka on Jun 6 2024, 3:49 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 11, 8:22 PM
Unknown Object (File)
Sat, Dec 7, 3:32 AM
Unknown Object (File)
Nov 16 2024, 6:14 AM
Unknown Object (File)
Nov 11 2024, 6:11 AM
Unknown Object (File)
Nov 11 2024, 6:02 AM
Unknown Object (File)
Nov 11 2024, 4:46 AM
Unknown Object (File)
Nov 11 2024, 2:16 AM
Unknown Object (File)
Nov 11 2024, 1:28 AM
Subscribers

Details

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
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

inka requested review of this revision.Jun 6 2024, 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.Jun 6 2024, 4:18 AM
inka planned changes to this revision.Jun 6 2024, 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.Jun 6 2024, 5:08 AM
lib/socket/user-infos-handler.react.js
14–35 ↗(On Diff #41035)

Personally I think this would be cleaner

This revision was automatically updated to reflect the committed changes.