-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Should didUpdate be triggered on reload? #3748
Comments
I was running into the same issue, being unable to properly observe changes to a current record that is initiated by the server via pushPayload: https://discuss.emberjs.com/t/observe-reload-changes-to-model/13182 I noticed emberfire is currently having an open issue with a similar issue: FirebaseExtended/emberfire#497 I have been trying to find out if there is a reason for ember data to not trigger any hooks via pushPayload, however nobody was able to come up with a reason so far. I think it would make things a lot easier if we had a consistent behaviour for something like didUpdate (which actually sounds like it should trigger every time the record gets updated on the server - and hence the client). At least it seems to be possible to work around this issue by using a customised adapter, as described in the ember fire issue. |
I notice that the when the store does a background reload or even store.findRecord({reload: true}) the ready or didLoad hooks are not called again, which I think is a flaw. |
I think it makes sense to trigger |
Yes! I would really like to get this resolved. It makes it quite difficult to use things like ember changeset together with server push. Or write components that display data of a record without getting out of sync. Do we need an application that shows the issue? I think it should be sufficient to agree on the wanted behavior - and then have a look at the existing tests? |
@wecc any conclusions from team discussions? need help implementing this if you are ok with the basic idea of calling didLoad after reload, pushPayload etc. |
We are looking to deprecate record events/event-hooks in favor of using promises and functional patterns. Closing this because we do not with to add more complexity to a layer we are seeking to remove. |
@runspired Is there an Issue or RFC to track this pattern change? |
I just found Also Is there any alternative to |
@ro0gr didUpdate does work, more likely this wasn't a situation in which an update was performed. |
Oh, then that is probably related to version of ED@3.12 which I'm currently pinned to. I'll check. Thanks for letting me know |
I stumbled across an issue in my current app, I was under the impression that a reload would trigger a didUpdate event of a model, but it only seems to be triggered when calling save. Looks like I'm not the only one #1441.
Shouldn't didUpdate be triggered when the model gets updated from the server (either via reload, save, pushPayload etc...)?
The text was updated successfully, but these errors were encountered: