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

DOCUMENT_MODIFIED action leaves id undefined in ordered listener when order changes #292

Open
wp-consulting opened this issue Jul 2, 2020 · 2 comments

Comments

@wp-consulting
Copy link

What is the current behavior?
When a document is modified in such a way that a listener gets a document update, the dispatched DOCUMENT_MODIFIED action updates the ordered array to have an undefined id. This does not occur when a document update does not affect the order of the ordered result.

What is the expected behavior?
Document updates should still return id after updating ordered result in redux

Which version of redux-firestore are you using? What about other dependencies?
"redux-firestore": "^0.13.0"
"react-redux-firebase": "^3.6.0"
"firebase": "^7.15.5"

Which environments/browsers are affected by this issue? Did this work in previous versions or setups?
Have tested on Safari, Firefox and Chrome in OS X development environment. Have not seen in previous versions or setups.

Minimal demo to reproduce issue (using codesandbox or similar)
Have ordered listener with storeAs value and modify a document such that the order would change. Once DOCUMENT_MODIFIED action dispatches the modified document no longer includes an id in ordered result in redux.
The first return statement of the modifyDoc function in reducers/orderedReducer.js is returning the action.payload.data without an id. We implemented a patch-package that spreads the action.meta.doc with action.payload.data in the newArrayWithItemMoved call that resolved the issue for us.

@albertcui
Copy link

albertcui commented Jul 11, 2020

Seeing this problem as well w/ the same dependencies

@puppybits
Copy link
Contributor

I fixed this bug. PR #308 is waiting to be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants