Page MenuHomePhabricator

[web] Migrate drafts to db for everyone
ClosedPublic

Authored by michal on Sep 8 2023, 6:54 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 25, 7:46 PM
Unknown Object (File)
Mon, Nov 25, 6:00 PM
Unknown Object (File)
Mon, Nov 11, 7:08 PM
Unknown Object (File)
Fri, Nov 8, 12:27 AM
Unknown Object (File)
Fri, Nov 8, 12:27 AM
Unknown Object (File)
Fri, Nov 8, 12:27 AM
Unknown Object (File)
Fri, Nov 8, 12:08 AM
Unknown Object (File)
Thu, Nov 7, 8:05 PM
Subscribers

Details

Summary

Part of ENG-4844
Depends on D9109

We need to migrate drafts for all users to the db.

Test Plan

Tested on chromium:

  • [on master] Replaced code in isSQLiteSupported:
return false; // <- added
if (!isDev && (!currentLoggedInUserID || !isStaff(currentLoggedInUserID))) {
  return false;
}
  • logged in, made sure that there is persist:root in local storage, created a draft, closed the web page
  • [Applied this diff] opened the web page, and checked if the draft are still there

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

michal requested review of this revision.Sep 8 2023, 7:12 AM

Instead of removing the previous migration, make it noop.

The reason why we can ignore this migration is because either:

  • user is a staff user and we can assume that most staff users are already on version >= 2
    • I don't think it's worth handling the edge case of staff users still on version 1
  • user is not a staff user, in which case the migration was a noop anyway
    • (but after changes in previous diffs, the database would be supported and so this migration would run, incorrectly)
This revision is now accepted and ready to land.Sep 11 2023, 12:33 AM