Skip to content

Conversation

rueckstiess
Copy link
Contributor

@rueckstiess rueckstiess commented Apr 27, 2016

Summary

  1. Introduces app migrations in the main process (in addition to app migrations in the renderer process).
  2. Adds a main process migration point at 1.2.0 to rename the user data directory from mongodb-compass to MongoDB Compass
  3. Adds a renderer process migration point at 1.2.0 to convert preferences and user data from IndexedDB to a JSON file-based backend

What's going on here?

The main process cannot access the data stored in IndexedDB (without spawning an electron window, which we'd like to avoid here). Since 1. happens before 3. the main process migration in this version cannot detect the last known version (which is part of the user preferences). Therefore, it will assume 0.0.0 since no JSON-stored data is present, which will trigger the newly added migration point at 1.2.0. However, future versions will be able to read the preference data and detect the last known version even in the main process.

Testing and Verification

To test, I recommend the following steps:

  1. Run Compass version 1.1.4 (e.g. installed binary from downloads.mongodb.com). Create some recognizable connection favorites, and make sure at least one of the three "opt-in" settings is enabled and disabled respectively (so you can recognize the settings after the migration).
  2. Quit Compass 1.1.4
  3. In the Finder / File Explorer, open the parent folder of the user data directory. On OS X, this is ~/Library/Application Support/
  4. Notice the directory mongodb-compass
  5. Start Compass 1.2.0-dev (npm start)
  6. During start, you should see the following steps
    • A new MongoDB Compass directory is created
    • The old mongodb-compass directory disappears (because it is copied to MongoDB Compass)
    • The app shows the Connect Dialog with the previously created favorites
  7. After connecting to a server, open the "Help - Help Improve Compass" menu. The preferences should be as selected previously. No opt-in dialog should appear unprompted.
  8. Quit and relaunch version 1.2.0-dev again. There should be no errors, warnings, etc and all saved settings should be as before.

This change is Reviewable

@imlucas imlucas force-pushed the INT-1393-migrate-userdata branch from e65317a to 2da352c Compare April 27, 2016 15:36
@imlucas
Copy link
Contributor

imlucas commented Apr 27, 2016

:lgtm:


Reviewed 9 of 9 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@imlucas imlucas merged commit 8f5f02d into master Apr 27, 2016
@imlucas imlucas deleted the INT-1393-migrate-userdata branch April 27, 2016 15:41
"mongodb-ns": "^1.0.3",
"mongodb-schema": "^4.2.0",
"ms": "^0.7.1",
"npc": "0.0.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo. you wanted "ncp", not "npc". I'll fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants