Page MenuHomePhabricator

[keyserver] Change device_token to mediumtext
ClosedPublic

Authored by michal on Feb 13 2023, 6:36 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 9, 9:01 AM
Unknown Object (File)
Sun, Mar 31, 8:14 AM
Unknown Object (File)
Sun, Mar 31, 8:13 AM
Unknown Object (File)
Sun, Mar 31, 8:13 AM
Unknown Object (File)
Sun, Mar 31, 8:13 AM
Unknown Object (File)
Sun, Mar 31, 8:13 AM
Unknown Object (File)
Sun, Mar 31, 8:06 AM
Unknown Object (File)
Fri, Mar 29, 2:53 AM
Subscribers

Details

Summary

Part of EMG-2825.

We need to save web push subscription info on the keyserver inside the device_token. Unfortunately it's too long for the current VARCHAR(255) so this diff changes that to a mediumtext. Additionaly indices had to be modified because of the the type change. Now we need to specify a prefix length that they apply to. I've tested it and it seems like registration info is 400-500 bytes so I've set it to 512.

Test Plan
  • Check that existing device_token rows weren't changed after running the migration
  • For android and ios emulators
    • create a new user, check if notifications work
    • run migration
    • check if notifications still work

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ashoat requested changes to this revision.EditedFeb 13 2023, 3:12 PM

Can you amend the Test Plan to include confirming that the text wasn't visibly changed, and that iOS / Android notifs still work in the dev environment?

keyserver/src/database/migration-config.js
154 ↗(On Diff #22423)

Can you format the JS the same as other queries in the file?

158 ↗(On Diff #22423)

The migration above this breaks this rule, but we should stay within 80 chars

158 ↗(On Diff #22423)

Did you verify that the text is preserved when running this migration?

This revision now requires changes to proceed.Feb 13 2023, 3:12 PM

Changed formatting, updated the test plan

This revision is now accepted and ready to land.Feb 14 2023, 5:47 AM