Page MenuHomePhabricator

[lib] Add extractUserIDsFromPayload
ClosedPublic

Authored by inka on May 10 2024, 6:01 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 16, 6:04 PM
Unknown Object (File)
Mon, Dec 16, 6:04 PM
Unknown Object (File)
Mon, Dec 16, 6:04 PM
Unknown Object (File)
Mon, Dec 16, 6:04 PM
Unknown Object (File)
Mon, Dec 16, 6:04 PM
Unknown Object (File)
Fri, Dec 6, 7:05 AM
Unknown Object (File)
Nov 1 2024, 11:20 PM
Unknown Object (File)
Oct 26 2024, 5:01 AM
Subscribers

Details

Summary

issue: ENG-7820
We want to extract all ids of users included in the server responses. We will use validators for this. convertObject run a DFS over provided data and outputValidator. When it encounters any of typesToConvert (in my case - tUserID) it calls the provided conversionFunction.

Test Plan

Tested the function by calling it on the result of threadJoinResponder:
I had a community with members user1, user2, user3 , user4. I had a subchannel in this community with members user1 and user2. I made user4 join this subchannel. The function exctracted the ids of all user1, user2, user3 , user4 from the result. This is correct, because they were present in result.updatesResult.newUpdates[0].threadInfo.members (they all had a membership because they belong to the community).

Diff Detail

Repository
rCOMM Comm
Branch
inka/userStore
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.May 10 2024, 6:02 AM
Harbormaster failed remote builds in B28830: Diff 40065!
inka requested review of this revision.May 13 2024, 6:02 AM

Looks good, letting others review as well.

Might be a good idea to add unit test to conversion-utils.test.js - I see there are tests for other functions in this file

This revision is now accepted and ready to land.May 14 2024, 12:50 AM
This revision was automatically updated to reflect the committed changes.