status-desktop/ui/app/AppLayouts/Communities
Jonathan Rainville 6d78ba83a2
fix(permissions): fix hang when all channel perm check return (#14259)
* fix(permissions): fix hang when all channel perm check return

Fixes #14234

The problem was that we updated **all** the models from **all** the channels of a community each time the channel requirement checks returned.

The fix is to first of all, make sure we don't call that check too often. It sometimes got called twice in a row by accident.

The other better fix is to check if anything actually changed before updating. This solves the issue almost entirely.  Since the permissions almost never change, the updates now take only a second.

* fix(permisisons): never run permission checks for privileged users

Also fixes #14234 but for admins, TMs and Owners.

Admins+ were still getting the hang, because the permission checks always returned something different than the models, because the models knew that admins have access to everything, but the permission check was running as if it were a normal user (I think, un-tested).

Anyway, the solution is more simple, we never need  to run the permission checks on admins+, because they always have access to everything!

* fix(Communities): prevent channels model from emitting unnecessary signals

Closes: #14274

* chore(Communities): improve channels metadata lookup performance

ChannelsSelectionModel is removed, replaced with plain LeftJoinModel.
Transformations of left-side model are done in a single place, not in
every delegate making the join.

* only call update functions when there is something to update + move permission model creation when needed

---------

Co-authored-by: Michał Cieślak <michalcieslak@status.im>
2024-04-03 17:55:33 -04:00
..
controls [Create new community popup]: Adjusted request to join 2024-02-22 11:42:33 +02:00
helpers fix(@desktop/permissions): Handle correct values in permissions 2024-02-27 19:33:27 +01:00
layouts feat: Update Edit community settings based on new design 2023-07-06 09:47:46 +03:00
models feat(ChannelPermissions): Add permissions section in create/edit channel popup 2024-02-07 19:54:47 +02:00
panels fix(permissions): fix hang when all channel perm check return (#14259) 2024-04-03 17:55:33 -04:00
popups chore(general): removing unneeded qml file 2024-03-25 13:17:56 -04:00
stores fix(DisplayNameValidation): Integrate duplicate display name in joined communities 2024-03-14 09:18:39 +02:00
views fix(permissions): fix hang when all channel perm check return (#14259) 2024-04-03 17:55:33 -04:00
CommunitiesPortalLayout.qml feat(desktop@communities): change kicked/banned member behavior (#13706) 2024-02-27 12:55:56 +01:00
qmldir feat(Communities): Communities folder reorganization 2023-06-28 14:28:47 +02:00