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

WIP: feat: handle concurrent updates to newly created record & upgrade deps #246

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Commits on Nov 11, 2019

  1. fix: support multiple createRecord calls (fixes pouchdb-community#239)

    This commit changes how ember-pouch implements `Adapter.createRecord`,
    which is invoked after calling `.save()` on a new record,
    so that it does not create multiple records if `.save()` is called
    more than once before the first operation has finished.
    
    If `.save()` is only invoked once before the record has finished persisting
    to the DB (i.e. the promise that it returns has resolved) then
    the behavior is unchanged. However, subsequent calls will wait for
    the previously returned promise to resolve and then, if changes have
    been made to the record, it will delegate the task to `updateRecord`.
    
    To avoid a problem caused by ember-data changing the ID associated
    with the internalModel/record when the record has finished persisting,
    the `Adapter.generateIdForRecord` method has been implemented so
    that it is available immediately. Previously ember-pouch had still
    been generating this id during `createRecord`, but ember-data was
    not being made aware of this until its returned promise resolved.
    
    Finally, rather than rely on `adapter.db.rel.uuid()` to generate
    an RFC4122 v4 UUID (requiring initialization to have completed),
    this has been replaced by the equivalent `uuid` module from npm,
    and the ember-auto-import addon has been installed to make it
    easy to access this from within ember-pouch.
    jacobq committed Nov 11, 2019
    Configuration menu
    Copy the full SHA
    881c84b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    dea8126 View commit details
    Browse the repository at this point in the history
  3. ci: test on node 8

    BREAKING CHANGE: drop support for NodeJS versions prior to 8.0.0
    jacobq committed Nov 11, 2019
    Configuration menu
    Copy the full SHA
    7bf44ad View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    eb4b66b View commit details
    Browse the repository at this point in the history
  5. chore: upgrade dependencies

    jacobq committed Nov 11, 2019
    Configuration menu
    Copy the full SHA
    e522f73 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    7f9b316 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f8d869b View commit details
    Browse the repository at this point in the history
  8. fix: appease eslint

    jacobq committed Nov 11, 2019
    Configuration menu
    Copy the full SHA
    8506a29 View commit details
    Browse the repository at this point in the history
  9. chore: run ember-qunit-codemod

    jacobq committed Nov 11, 2019
    Configuration menu
    Copy the full SHA
    70993fc View commit details
    Browse the repository at this point in the history
  10. test: fix autoboot problem

    Some of the changes introduced while updating
    ember / ember-cli, resulted in test failures
    resembling the problem described at the URL below:
    emberjs/ember-qunit#309
    jacobq committed Nov 11, 2019
    Configuration menu
    Copy the full SHA
    931b42f View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    a6fe0b7 View commit details
    Browse the repository at this point in the history
  12. test: fix store.unloadAll race condition in tests

    The test labeled "creating an associated record stores
    a reference to it in the parent" was failing intermittently
    when run with other tests under conditions "dont save hasMany"
    and "sync". This problem appears to be caused by the
    test logic not waiting for `store.unloadAll()` to complete.
    The Ember Data API docs state that this function schedules
    its work to be done during the next run loop.
    However, instead of adding a delay and making assumptions
    about this, we wrap calls to this function in `run` to
    ensure that it has finished before continuing.
    
    See also:
    
    * https://api.emberjs.com/ember-data/3.14/classes/Store/methods/unloadAll?anchor=unloadAll
    * pouchdb-community#242
    * pouchdb-community#243
    jacobq committed Nov 11, 2019
    Configuration menu
    Copy the full SHA
    7d12ebc View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    76efda9 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    52b80c3 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    a966968 View commit details
    Browse the repository at this point in the history