Page MenuHomePhabricator

[lib] Fix `threadPermissionsFromBitmaskHex` invariant
ClosedPublic

Authored by atul on Dec 11 2023, 2:23 PM.
Tags
None
Referenced Files
F4951481: D10296.diff
Thu, Mar 20, 2:54 PM
F4948094: D10296.id34578.diff
Wed, Mar 19, 7:25 PM
F4948093: D10296.id34577.diff
Wed, Mar 19, 7:25 PM
F4948092: D10296.id34490.diff
Wed, Mar 19, 7:25 PM
F4948091: D10296.id.diff
Wed, Mar 19, 7:25 PM
Unknown Object (File)
Sun, Mar 9, 4:59 AM
Unknown Object (File)
Sat, Mar 1, 3:07 AM
Unknown Object (File)
Wed, Feb 26, 10:59 AM
Subscribers
None

Details

Summary

Really shouldn't have made this mistake...

After moving things around to resolve circular dependency issue, I accidentally started using the tHexEncodedRolePermission check in threadPermissionsFromBitmaskHex instead of the tHexEncodedPermissionsBitmask check...

This required that we have >=3 hex characters, when there's no such minimum for thread permissions.

Caught this during native testing thanks to thread where permissions for some user were "3", which should have been valid.

I read through minimally-encoded-thread-permissions again very carefully to see if there were any other mistakes I could find. I think part of the reason for the error may have been the similar-ish naming of all the utilities/etc. I'll see if I can update those to be more clear.

Also went ahead and included unit test that would've caught the issue earlier.


Depends on D10295

Test Plan

Unit test, careful re-reading of threadPermissionsFromBitmaskHex.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable