Page MenuHomePhabricator

[keyserver] Run migration to update thread pinned_counts
ClosedPublic

Authored by rohan on Aug 4 2023, 8:34 AM.
Tags
None
Referenced Files
F3285135: D8732.id29548.diff
Sat, Nov 16, 12:26 PM
Unknown Object (File)
Mon, Nov 11, 4:56 PM
Unknown Object (File)
Sat, Oct 19, 5:06 AM
Unknown Object (File)
Sat, Oct 19, 5:06 AM
Unknown Object (File)
Sat, Oct 19, 5:06 AM
Unknown Object (File)
Sat, Oct 19, 5:06 AM
Unknown Object (File)
Sat, Oct 19, 5:06 AM
Unknown Object (File)
Sat, Oct 19, 5:04 AM
Subscribers

Details

Summary

Based on the changes made in D8683, we should also run a
safeguard migration to update the threads.pinned_count values to match
the number of messages in the database that are pinned for each thread.

Depends on D8683

Test Plan
  1. Pinned some messages
  2. Set the threads.pinned_count = 0 to emulate a corrupt state that could occur because of this bug (invalid pinned_count value)
  3. Run the query
  4. Ensure that the pinned count values updated

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rohan requested review of this revision.Aug 4 2023, 8:51 AM
ashoat added inline comments.
keyserver/src/database/migration-config.js
495–505 ↗(On Diff #29546)
  1. You can just return the promise directly
  2. Skip the semicolon unless using multipleStatements: true
This revision is now accepted and ready to land.Aug 4 2023, 8:54 AM