Page MenuHomePhabricator

[lib] Block user from writing in sidebars
ClosedPublic

Authored by michal on Oct 3 2022, 6:58 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 26, 5:00 PM
Unknown Object (File)
Tue, Nov 26, 5:00 PM
Unknown Object (File)
Tue, Nov 26, 5:00 PM
Unknown Object (File)
Tue, Nov 26, 5:00 PM
Unknown Object (File)
Tue, Nov 26, 4:48 PM
Unknown Object (File)
Nov 8 2024, 3:17 AM
Unknown Object (File)
Oct 28 2024, 5:09 AM
Unknown Object (File)
Oct 28 2024, 5:09 AM
Subscribers

Details

Summary

ENG-38
This diff fixes the issue where blocked user could still write in the previously created sidebars.

Test Plan

Tested between an emulator and web:

  1. Create a personal 1-1 chat with other user, block the other user -> neither user can write nor edit properties of the chat and it's sidebars
  2. Create a personal 1-1 chat with admin, block admin -> both user can still write and edit
  3. Create a chat with 3 users, block one -> all users can still write
    • then remove the unblocked user -> neither user can write nor edit

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

michal requested review of this revision.Oct 3 2022, 7:08 AM

This solution makes sense to me. The last diff to touch this code was D1904, and there I said:

This change only solves the issue for PERSONAL threads. To solve it for all one-on-one threads, I could revise the logic to filter non-member out of the threadInfo.members checks performed by threadOrParentThreadIsGroupChat and threadOrParentThreadHasAdminRole. The downside of that approach is that it would be less readable, and in an ideal world the hack won't be necessary for too long. I could be easily convinced to switch to it, though.

This diff seems to implement that solution.

This revision is now accepted and ready to land.Oct 3 2022, 9:55 AM