Check minimally encoded permissions for permission via hasPermission in threadMemberHasPermission based on minimallyEncoded flag.
Depends on D9840
Differential D9841
[lib] Update `threadMemberHasPermission` to support `MinimallyEncodedRawThreadInfo` atul on Nov 13 2023, 11:19 AM. Authored by Tags None Referenced Files
Details Check minimally encoded permissions for permission via hasPermission in threadMemberHasPermission based on minimallyEncoded flag. NOTE: One thing I noticed when I was making this change was that permissionLookup always checks for the threadPermissions.KNOW_OF permission during permissions checks and fails all checks where KNOW_OF isn't present. Looks like this logic was added by @ashoat in https://phab.comm.dev/D1213. If this is still relevant, should I update hasPermission to always ensure that KNOW_OF bit is set?
Depends on D9840 Will add unit tests in future, for now counting on Flow.
Diff Detail
Event TimelineComment Actions
Yes, absolutely. The default should definitely be "match existing code" – if you ever have a question like this in the future for this project, please default to matching existing code, instead of doing things differently and hoping your reviewer will notice a question in the diff summary. Comment Actions Makes sense, will update hasPermission. Had previously looked at: when implementing hasPermission so didn't come across the KNOW_OF requirement. I'm guessing that threadHasPermission should also be updated to "go through" permissionLookup? Comment Actions
Was initially guessing that's not necessary since I figured permissionLookup gets called for each individual permission on the keyserver before it's delivered to the client. So if a blob is missing KNOW_OF, on the client it should appear completely empty (no permissions). That said, did a git grep and saw a threadHasPermission was recently introduced on keyserver. It's kind of risky to leave threadHasPermission in this weird state where it should only be used in certain places – probably best to update it as you suggest. Before landing, can you create a task to track fixing up threadHasPermission? |