-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
fetchAndAdd returns always cached data for dynamic firestorePath #262
Comments
@RolandCsibrei thanks for looking into this and also providing me with a solution. I made the change as per your suggestion in v1.34.5 -- |
Sadly this doesn't fix all the issues. The following code snipet shows the problem with caching: export const code = {
firestorePath: 'codelist/{list}/values',
firestoreRefType: 'collection',
moduleName: 'code',
statePropName: 'codes',
namespaced: true,
state: {
},
actions: {
async getCodes ({ dispatch }) {
dispatch('fetchAndAdd', { list: 'list1' })
dispatch('fetchAndAdd', { list: 'list2' })
dispatch('fetchAndAdd', { list: 'list3' })
// make some changes in the FB console and call getCodes again
// changes are not reflected, data is read from the cache
}
}
} In some cases this behaviour is ok, however maybe an option should be added, like Thank you! |
The cached data got crazy after calling |
@RolandCsibrei |
Writing from my phone so I will be less verbose. If you call fetchaAndAdd with pathVariable1 it returns fresh data, no caching. Call fetchaAndAdd again with pathVariable2, returns fresh data, no caching. Now call fetchaAndAdd with the same pathVariable1, it hits the cache, returns data, but dbrefs seems to be bound to data defined by pathVariable2, and not pathVariable1. |
@RolandCsibrei I completely understand now. I'll try and create a failing test based on these steps, then I'll try to fix that test asap. |
After about two years of open source, I finally got accepted for Github Sponsors! 💜 github.com/sponsors/mesqueeb 💜A little about me:
If anyone was helped with vuex-easy-firestore, I'd greatly appreciate any support!
Going forward 👨🏼💻
|
I am wondering if we should allow the change of path variables after instantiation. |
Using a single module relates to #164 |
Despite that
list
changes ingetCodes
, the result is still read from cache, becausepathVariables
are not taken into account when building theidentifier
:vuex-easy-firestore/src/module/actions.ts
Line 244 in d94b673
Can be?
The text was updated successfully, but these errors were encountered: