Skip to content

bug(orderedReducer): ordered collection is not updating if using orderBy with desc #239

Open
@sintylapse

Description

What 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

Screen Shot 2019-09-18 at 15 39 14

If I go back and open screen again, everything is ordered fine again.

Screen Shot 2019-09-18 at 15 46 22

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",

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions