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
Unknown Object (File)
Fri, Nov 29, 12:17 AM
Unknown Object (File)
Sat, Nov 23, 11:43 PM
Unknown Object (File)
Sat, Nov 23, 11:42 PM
Unknown Object (File)
Sat, Nov 23, 11:42 PM
Unknown Object (File)
Sat, Nov 23, 11:42 PM
Unknown Object (File)
Sat, Nov 23, 1:57 PM
Unknown Object (File)
Sat, Nov 23, 12:57 PM
Unknown Object (File)
Nov 19 2024, 5:08 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