Page MenuHomePhabricator

[keyserver] Change device_token to mediumtext
ClosedPublic

Authored by michal on Feb 13 2023, 6:36 AM.
Tags
None
Referenced Files
F1441477: D6714.diff
Fri, Mar 29, 2:53 AM
F1440515: D6714.id23282.diff
Thu, Mar 28, 10:07 PM
F1440514: D6714.id22814.diff
Thu, Mar 28, 10:07 PM
F1440513: D6714.id22560.diff
Thu, Mar 28, 10:07 PM
F1440512: D6714.id22423.diff
Thu, Mar 28, 10:06 PM
F1440511: D6714.id.diff
Thu, Mar 28, 10:06 PM
Unknown Object (File)
Mon, Mar 25, 7:20 PM
Unknown Object (File)
Mon, Mar 25, 2:04 PM
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

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

158

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

158

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