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: handle products without positions obj #4301

Merged
merged 1 commit into from
Jun 6, 2018

Conversation

aldeed
Copy link
Contributor

@aldeed aldeed commented Jun 5, 2018

Resolves #4299
Impact: minor
Type: bugfix

Issue

If any documents in Catalog collection do not have a positions property, migration fails on startup on first start after migration to v1.12.0. The migration is left locked. The error message is:

0|reaction | TypeError: Cannot convert undefined or null to object
0|reaction |     at Function.keys (<anonymous>)
0|reaction |     at items.forEach (imports/plugins/core/versions/server/migrations/25_update_catalog_schema.js:28:12)

Solution

Handle undefined positions prop in the migration.

Breaking changes

NONE

Testing

  1. Start Reaction with v1.11.0 and load data.
  2. In Mongo, make sure at least one document in Catalog collection has no positions property.
  3. Upgrade code to v1.12.0
  4. Start Reaction and make sure all migrations run without issue, and the app runs properly afterward.

in catalog schema migration without error
@aldeed aldeed self-assigned this Jun 5, 2018
@aldeed aldeed requested a review from brent-hoover June 5, 2018 11:40
@spencern
Copy link
Contributor

spencern commented Jun 5, 2018

@zenweasel once you've confirmed this fix, we'll push this out as 1.12.1

Copy link
Collaborator

@brent-hoover brent-hoover left a comment

Choose a reason for hiding this comment

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

Tested. Verified fixed

@spencern spencern changed the base branch from master to release-1.12.1 June 6, 2018 00:09
@spencern spencern merged commit 227618d into release-1.12.1 Jun 6, 2018
@spencern spencern deleted the fix-4299-aldeed-catalog-migration branch June 6, 2018 00:09
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