Page MenuHomePhabricator

[lib] Add `invariant` to suppress `flow` issue in `getPushUserInfo`
AbandonedPublic

Authored by atul on Jul 10 2024, 2:42 PM.
Tags
None
Referenced Files
F3134806: D12722.diff
Sat, Nov 2, 3:52 PM
Unknown Object (File)
Fri, Oct 18, 2:36 PM
Unknown Object (File)
Fri, Oct 18, 2:35 PM
Unknown Object (File)
Fri, Oct 18, 2:35 PM
Unknown Object (File)
Mon, Oct 14, 11:34 PM
Unknown Object (File)
Fri, Oct 11, 6:50 PM
Unknown Object (File)
Fri, Oct 11, 4:53 PM
Unknown Object (File)
Oct 2 2024, 12:50 PM
Subscribers

Details

Reviewers
ashoat
marcin
Summary

There are new client-side member permission checks in getPushUserInfo which I believe (and hope...) are only relevant for ThickRawThreadInfos.

getPushUserInfo gets called by preparePushNotifs gets called by usePreparePushNotifs which isn't used anywhere at this point.

Putting in invariants instead of $FlowIgnore so that it's harder to miss if any ThinRawThreadInfos make it to this point... which should be an error case because ThinRawThreadInfos will not have any permissions.

Fixing things here is tracked in https://linear.app/comm/issue/ENG-8809/modify-functions-in-send-utilsjs-in-to-operate-only-on


Depends on D12597

Test Plan

flow

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

atul published this revision for review.Jul 10 2024, 2:44 PM

Gonna leave this one for @marcin to confirm:

I believe (and hope...) are only relevant for ThickRawThreadInfos.

Also, there appear to be ESLint issues here that would need to be resolved prior to landing

This function is supposed to be used exclusively with thick threads.

This revision is now accepted and ready to land.Jul 12 2024, 2:09 AM
ashoat requested changes to this revision.Jul 12 2024, 7:22 AM

Requesting changes for ESLint

This revision now requires changes to proceed.Jul 12 2024, 7:22 AM
ashoat requested changes to this revision.Jul 17 2024, 12:07 PM

There is a Flow issue. Can you please either pass this diff back to me when it's fully green, or else explain why there need to be CI issues?

lib/shared/thread-utils.js
88 ↗(On Diff #42298)

Why did you put this here? Can you please move this fix to where it belongs? Presumably you have an earlier diff in the stack that introduced this ESLint issue – it should be resolved there

This revision now requires changes to proceed.Jul 17 2024, 12:07 PM

Looks like the Flow issue is resolved in D12755, but still would like to see the ESLint fix moved to the diff where the issue is introduced. Let me know if I'm off-base or missing something

atul requested review of this revision.Jul 17 2024, 2:14 PM

still would like to see the ESLint fix moved to the diff where the issue is introduced.

The fix has been moved to D12597.

ashoat requested changes to this revision.Jul 18 2024, 10:17 AM

Looks like D12784 has been landed, so this can be abandoned after you rebase

This revision now requires changes to proceed.Jul 18 2024, 10:17 AM

Can drop this now, thanks @marcin !