Page MenuHomePhabricator

[lib] Replace `innerThreadFrozenDueToBlock` with `threadIsWithBlockedUserOnlyWithoutAdminRoleCheck` in `useThreadsWithPermission`
ClosedPublic

Authored by atul on Jun 3 2024, 1:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 10, 5:27 PM
Unknown Object (File)
Sun, Nov 10, 3:49 PM
Unknown Object (File)
Sun, Nov 10, 8:23 AM
Unknown Object (File)
Fri, Nov 8, 1:52 PM
Unknown Object (File)
Fri, Nov 8, 11:31 AM
Unknown Object (File)
Fri, Nov 8, 7:15 AM
Unknown Object (File)
Tue, Oct 29, 1:53 PM
Unknown Object (File)
Tue, Oct 29, 12:51 AM
Subscribers
None

Details

Summary

This allows us to narrow things as threadIsWithBlockedUserOnlyWithoutAdminRoleCheck only accepts ThreadInfo and will help us remove ThreadInfo from memberHasAdminPowers.memberInfo argument without that invariant.


Depends on D12289

Test Plan

flow + close reading

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul published this revision for review.Jun 3 2024, 1:27 PM
atul added inline comments.
lib/shared/thread-utils.js
179 ↗(On Diff #40899)

What was set to true here was skipMemberAdminRoleCheck option. The checkOnlyViewerBlock option was set within innerThreadFrozenDueToBlock.

179 ↗(On Diff #40899)

What is set to false here is the checkOnlyViewerBlock option, there's no skipMemberAdminRoleCheck option when calling threadIsWithBlockedUserOnlyWithoutAdminRoleCheck because the whole point is that we only accept ThreadInfo and handle admin role check separately.

tomek added inline comments.
lib/shared/thread-utils.js
179 ↗(On Diff #40899)

Can we introduce an object param instead of multiple params with an unobvious meaning?

This revision is now accepted and ready to land.Jun 4 2024, 1:51 AM
lib/shared/thread-utils.js
179 ↗(On Diff #40899)

We actually introduced and un-introduced object param in this stack, there's just one option now.

This revision was landed with ongoing or failed builds.Jun 16 2024, 5:35 PM
This revision was automatically updated to reflect the committed changes.