Skip to content
This repository has been archived by the owner on Oct 19, 2018. It is now read-only.

Model.all.count increments twice on client doing a save. #94

Open
catmando opened this issue May 1, 2018 · 0 comments
Open

Model.all.count increments twice on client doing a save. #94

catmando opened this issue May 1, 2018 · 0 comments
Labels

Comments

@catmando
Copy link
Contributor

catmando commented May 1, 2018

If you do Model.all.count without for example doing a Model.all.each ... . There will be no actual collection of records, just the count.

If you create a new record on the browser, the count (in this case) will increment by 2.

Why? Because on that client it sees the record being created (adds 1 to the count) and then milliseconds later receives a broadcast saying a new record was created (adds 1 to the count).

@catmando catmando added the bug label May 4, 2018
catmando added a commit that referenced this issue May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant