bug(orderedReducer): ordered collection is not updating if using orderBy with desc
See original GitHub issueWhat is the current behavior?
I connect to Firestore like this
firestoreConnect([
{
collection: 'emotions',
orderBy: ['updateDate', 'desc'],
},
]),
then I open the screen with collection and collections are ordered by updateDate (desc). Then if I update a record
newRecord.updateDate = new Date()
firestore
.collection('emotions')
.doc(record.id)
.update({ ...newRecord })
all content of the record will be updated, but not the order
If I go back and open screen again, everything is ordered fine again.
But order works fine if I use orderBy with asc instead of desc
What is the expected behavior? Should update collection order correctly according to it index
Which version of redux-firestore are you using? What about other dependencies? “redux-firestore”: “^0.9.0”, “react-redux-firebase”: “^2.4.1”, “react-native”: “0.59.10”,
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
orderByDesc or orderBy does not work in Client Scr...
Hello All, I received the error below when tried to modify "u_affected_user" field which leads "cmdb_ci" modifying due to Client.
Read more >ORDER BY DESC is not working right
Nothing's preventing you from loading to a temp-file first, then casting when going to the final destination. Numeric data should be stored in...
Read more >OrderBy query result is not ordered from cosmos db ...
Once I update a few documents from the result set , those are not part of the result set when I run the...
Read more >ORDER BY clause | Couchbase Docs
The ORDER BY clause sorts the result-set by one or more columns, in ascending or descending order.
Read more >SQL ORDER BY Keyword
The ORDER BY keyword is used to sort the result-set in ascending or descending order. ... To sort the records in descending order,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@prescottprue I think I just reproduced this issue in my own app. I’ve whipped up a sample here: https://codesandbox.io/s/firestore-sort-demo-3izym (relevant code is in
components\Sort\Sort.js
. Sorry in advance for the ugliness of my quick hack job, but hopefully it gets the point across.If you click the button a few times to swap data at indices
0
and1
, you’ll see how theordered
data gets a bit messy in memory.I’ll try to carve out some time to dig further into this soon myself though, but if you have any thoughts that’d be greatly appreciated.
Hi, sorry, don’t have a time right now. Is it okay if I request reopening this issue if I will be able to reproduce it again and will create reproduction example?