Page MenuHomePhabricator

[keyserver] Fix `avatarUpdateQuery`
ClosedPublic

Authored by atul on Apr 13 2023, 1:58 PM.
Tags
None
Referenced Files
F2185887: D7435.id25143.diff
Thu, Jul 4, 1:25 AM
Unknown Object (File)
Sat, Jun 29, 11:58 PM
Unknown Object (File)
Sat, Jun 29, 1:44 PM
Unknown Object (File)
Fri, Jun 28, 2:04 PM
Unknown Object (File)
Fri, Jun 28, 2:04 PM
Unknown Object (File)
Fri, Jun 28, 2:04 PM
Unknown Object (File)
Fri, Jun 28, 2:04 PM
Unknown Object (File)
Fri, Jun 28, 2:02 PM
Subscribers

Details

Summary

Just introduced this in D7430 and noticed a slight issue that left container column of an image avatar set until we set another image avatar.

Specifically, if we had an image avatar and switched to emoji avatar the container field of the previous image avatar upload would remain set.

This wouldn't cause any issues in practice (as things are now), but the state of the DB would not be "corrected" until we subsequently set an image avatar.

In order to fix this we adjust the logic to match what we have in the final UPDATE threads... query.

Test Plan
  1. Switch from image avatar to image avatar and ensure that contents of uploads table and threads table are correct.
  2. Switch from image avatar to emoji avatar and ensure that contents of uploads table and threads table are correct.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul published this revision for review.Apr 13 2023, 2:01 PM
atul added inline comments.
keyserver/src/updaters/thread-updaters.js
664–666 ↗(On Diff #25143)

Got it right here...

This revision is now accepted and ready to land.Apr 14 2023, 6:44 AM
This revision was landed with ongoing or failed builds.Apr 16 2023, 10:48 AM
This revision was automatically updated to reflect the committed changes.