Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 4326 mikemurray import me not #4327

Merged
merged 2 commits into from
Jun 14, 2018

Conversation

mikemurray
Copy link
Member

Resolves #4326
Impact: breaking
Type: bugfix

Issue

The Reaction importer tries to import data into various collections, even if data already exists. It tries to be smart about merging, but sometimes that results in unpredictable behavior. This will prevent the app from starting and is not easily recovered from.

Solution

  • Collection.find().count() === 0 to wrap import statements in /server/startup/load-data.js
  • Guard against errors in /server/api/core/importer.js in Importer.commit.

Breaking changes

  • The Products, Shipping, and Tags collections will no longer have fixture data imported into if they have documents.
  • Modifying Product.json, Shpping.json or Tags.json will have no effect after the first import. Data will need to be imported using the Reaction importer directly.

Testing

  1. With a fresh app go to the PDP page as an admin
  2. Change the product title on the PDP page. I did Basic Reaction Product--
  3. Restart the app either with a code change or, stop/start
  4. The app should start with no errors, and the Basic Reaction Product should not be modified.
  5. Modify /private/data/Products.json and save.
  6. Wait for the app to refresh
  7. Observe that your changes have not been imported

@mikemurray mikemurray requested a review from spencern June 14, 2018 18:28
Copy link
Contributor

@spencern spencern left a comment

Choose a reason for hiding this comment

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

Tested and reproduced error. This PR fixes. 👍

@spencern spencern merged commit 321c41b into release-1.13.0 Jun 14, 2018
@spencern spencern deleted the fix-4326-mikemurray-import-me-not branch June 14, 2018 19:15
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.

2 participants