Skip to content

Guids for replicated models - #1140

Merged
bajtos merged 2 commits into
masterfrom
feature/guids-for-replicated-models
Mar 2, 2015
Merged

bajtos merged 2 commits into
masterfrom
feature/guids-for-replicated-models

Conversation

@bajtos

@bajtos bajtos commented Feb 26, 2015

Copy link
Copy Markdown
Member
  • Print a deprecation warning when a persisted model is tracking changes but does not have a client-generated unique string id property (GUID).
  • Fix all test models that are tracking changes so that they have a generated unique string id.
  • Make model names unique where possible to prevent tests reusing the same model which causes unintented side effects.

Closes #981

/to @ritch please review. I decided to use soft deprecation warning instead of throwing an exception. This way we are not breaking backwards compatibility and make the upgrade process easier (IMO).

Comment thread lib/persisted-model.js

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That regex is a bit silly.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Shall I rewrite it as !(id.Prop.defaultFn === 'uuid' || id.Prop.defaultFn === 'guid')?

@bajtos

bajtos commented Feb 27, 2015

Copy link
Copy Markdown
Member Author

Ouch, depd does not work in the browser :( I'll need to fix juggler as well.

@bajtos

bajtos commented Feb 27, 2015

Copy link
Copy Markdown
Member Author

Fixed, the patch depends on loopbackio/loopback-datasource-juggler#473 now.

@ritch LGTY now?

@bajtos bajtos mentioned this pull request Feb 27, 2015
3 tasks done
@ritch

ritch commented Mar 2, 2015

Copy link
Copy Markdown
Member

LGTM

@bajtos
bajtos force-pushed the feature/guids-for-replicated-models branch from 4f7d6b0 to f2c5af4 Compare March 2, 2015 16:01
@ritch ritch assigned bajtos and unassigned ritch Mar 2, 2015
Miroslav Bajtoš added 2 commits March 2, 2015 18:16
Print a deprecation warning when a persisted model is tracking changes
but does not have a client-generated unique string id property (GUID).
Fix all test models that are tracking changes so that they have
a generated unique string id.

Make model names unique where possible to prevent tests reusing
the same model which causes unintented side effects.
@bajtos
bajtos force-pushed the feature/guids-for-replicated-models branch from f2c5af4 to f21b29e Compare March 2, 2015 17:16
bajtos added a commit that referenced this pull request Mar 2, 2015
@bajtos
bajtos merged commit d24da8c into master Mar 2, 2015
@bajtos bajtos removed the #review label Mar 2, 2015
@bajtos
bajtos deleted the feature/guids-for-replicated-models branch March 2, 2015 17:23
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.

Enforce guid for replication

2 participants