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
F3187283: D9979.id33605.diff
Fri, Nov 8, 3:57 PM
F3177876: D9979.id33605.diff
Fri, Nov 8, 12:30 AM
Unknown Object (File)
Mon, Oct 21, 9:22 AM
Unknown Object (File)
Oct 2 2024, 4:13 AM
Unknown Object (File)
Oct 2 2024, 4:13 AM
Unknown Object (File)
Oct 2 2024, 4:12 AM
Unknown Object (File)
Oct 2 2024, 4:09 AM
Unknown Object (File)
Sep 22 2024, 3:35 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
No Lint Coverage
Unit
No Test Coverage

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