Page MenuHomePhabricator

[keyserver] Update usage of threads.default_role in thread-permission-updaters.js
ClosedPublic

Authored by rohan on Nov 24 2023, 9:56 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 9, 7:19 PM
Unknown Object (File)
Sun, Apr 28, 10:51 AM
Unknown Object (File)
Apr 8 2024, 6:03 PM
Unknown Object (File)
Apr 8 2024, 6:03 PM
Unknown Object (File)
Apr 8 2024, 6:00 PM
Unknown Object (File)
Apr 4 2024, 2:27 AM
Unknown Object (File)
Feb 25 2024, 1:28 PM
Unknown Object (File)
Feb 20 2024, 7:05 PM
Subscribers

Details

Summary

We need to get rid of usages of threads.default_role throughout the codebase so we can eventually drop the column.

This diff handles the usage in thread-permission-updaters.js

Existing code: When creating a new thread, changeRole(id, initialMembers, null) is called. The null role here specifies that a user is being added here, so this is the case we'll have to update. In changeRole, changeRoleThreadQuery(threadID, role) is called to get the intended role and permissions for the users being added to the thread. Naturally, this is the default_role column in MariaDB.

Depends on D9978

Addresses part of ENG-5833

Test Plan

Made sure that when new members were added, they are still assigned the default_role. Also ran the query before and after in TablePlus and made sure that the old default_role column value was equal to the new id column value.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Nov 24 2023, 11:02 AM
Harbormaster failed remote builds in B24406: Diff 33605!
This revision is now accepted and ready to land.Nov 27 2023, 3:09 AM