Skip to content

Enforce guid for replication #981

Closed

Description

@ritch

Replication in its current form does not support serial Number -ish ids. When a model is created on an offline client with a conflicting id created on the server loopback assumes that the models are the same.

This is easily prevented by using a guid id for your replicated models. Requires loopbackio/loopback-datasource-juggler#388.

/cc @raymondfeng @bajtos

Activity

  1. added this to the #Epic: Offline Sync V1 milestone on Jan 9, 2015
  2. self-assigned this
    on Jan 9, 2015
  3. bajtos commented on Jan 9, 2015

    @bajtos
    Member

    Replication in its current form does not support serial Number -ish ids. When a model is created on an offline client with a conflicting id created on the server loopback assumes that the models are the same.

    FWIW, it is possible to support serial Number ids using a modified hi-lo algorithm. However, that would require non-trivial implementation effort (about 5-8 story points).

    A comment in #933

    Changes are being tracked with the _id (ObjectID) instead of the value of the id field ('myIdProperty'). This completely breaks replication.

    Isn't this a problem affecting all apps using MongoDB with custom numeric id fields? Will updateOrCreate use the numeric id field or the generated _id field to decided whether the model is the same or not?

  4. ghost removed on Jan 27, 2015
  5. ghost added on Jan 27, 2015
  6. ghost removed on Feb 5, 2015
  7. ritch commented on Feb 18, 2015

    @ritch
    MemberAuthor

    Technically this is not a bug... but if you do not use GUIDs you will run into them fairly quickly.

  8. ghost added on Feb 18, 2015
  9. ghost removed on Feb 19, 2015
  10. ghost removed on Feb 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions