Skip to content

Ember Data creates duplicate records #1829

@ptmoy2

Description

@ptmoy2

Using Ember 1.4, EmberData beta 7 with default REST adapter. I don't have a JSBIN because problem only shows when there's a success reply from the server. Here's the scenario:

  1. create 2 routes, and transition to the 1st route.
  2. create a record: amd = store.createRecord ('myModel', myRecord);
  3. save the newly created record: md.save();
    note - server must return a success for problem to show. My server returned {status, 204}
  4. now transition to route 2 via link-to or something else, then hit the browser's back key to go
    back to route 1.
  5. when the 'back' button is pressed, Ember makes a GET request to the server.
    (why does Ember send a GET message when it already has it in the identity map?)
    Server replies with one instance of the saved record. Ember displays two instances of
    the saved record. Ember inspector also shows two instances.
  6. Now if the browser refresh button is pressed, Ember sends a GET to the server. Server replies
    with 1 record, and everything looks right again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy