question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug(reducers): documents with '.' (dot) character in their id are not correctly updated

See original GitHub issue

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

I’m listening to a subcollection like this:

firestoreConnect(({ userId }) => [{
  collection: `users/${userId}/favorites`,
  storeAs: 'favorites'
}])

The favorites are basically a collection of book ids. The book ids contain the ‘.’ (dot) character.

The initial LISTENER_RESPONSE populates the store correctly: screen shot 2018-09-19 at 17 18 18

But then if I try to add another book as favorite:

firestore.set(`users/${userId}/favorites/${bookId}`, {
  savedAt: firestore.FieldValue.serverTimestamp(),
});

It breaks the data store: screen shot 2018-09-19 at 17 22 25

Note that the ordered store is unaffected.

Also If I try to delete a favorite:

firestore.delete(`users/${userId}/favorites/${bookId}`);

It fails to delete it from the data store: screen shot 2018-09-19 at 17 26 01 screen shot 2018-09-19 at 17 26 25 screen shot 2018-09-19 at 17 26 41 screen shot 2018-09-19 at 17 27 32

What is the expected behavior?

When listening to a collection with documents using the ‘.’ (dot) characters in their id, it should correctly handle additions/updates/deletions in firestore.data.

Which versions of dependencies, and which browser are affected by this issue? Did this work in previous versions or setups?

This is happening with react-redux-firebase@2.1.6 and redux-firestore@0.5.7

This is within a React Native project 0.55.3 using react-native-firebase@4.1.0.

Steps to reproduce and if possible a minimal demo of the problem via codesandbox or similar.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
compojoomcommented, Oct 11, 2018

@prescottprue - please have a look at the pull request. I just did the same change in the case where there is no storeAs and meta.path

So far it looks good with our app.

0reactions
prescottpruecommented, Sep 5, 2019

Closed 427 of react-redux-firebase. Progress on fixing this will be tracked here

Read more comments on GitHub >

github_iconTop Results From Across the Web

bug (data): Document_modified from nested collection incorrectly ...
When a document gets updated and the DOCUMENT_MODIFIED is triggered it isn't merging the data correctly in the data reducer. What is the...
Read more >
256500 – Bug recognizing and creating folders starting with ...
The IDE has a bug on recognizing folders with names beginning with '.' (dot) character. ... Note: At least in windows, a folder...
Read more >
Can't type in React input text field - Stack Overflow
This might be caused by the onChange function is not updating the proper value which is mentioned in the input.
Read more >
Release Notes — Determined AI Documentation
WebUI: Fix a bug which caused the Experiment Details page to not render when the latest validation metric is not available. Version 0.13.5....
Read more >
Flex UI Release Notes for v1.x.x - Twilio
View the changelog for Twilio Flex v1 including new features, fixes, ... Fixed an issue where plugins were not loading correctly for customers...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found