Page MenuHomePhabricator

[lib] Add extractUserIDsFromPayload
ClosedPublic

Authored by inka on May 10 2024, 6:01 AM.
Tags
None
Referenced Files
F2153608: D11984.id.diff
Sun, Jun 30, 5:32 PM
Unknown Object (File)
Tue, Jun 25, 4:41 AM
Unknown Object (File)
Mon, Jun 24, 8:04 AM
Unknown Object (File)
Mon, Jun 24, 4:26 AM
Unknown Object (File)
Sun, Jun 23, 5:05 AM
Unknown Object (File)
Thu, Jun 20, 12:09 AM
Unknown Object (File)
Wed, Jun 19, 9:45 AM
Unknown Object (File)
Wed, Jun 19, 9:45 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.