-
Notifications
You must be signed in to change notification settings - Fork 69
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
Version is incrementing for dynamically added store and keeps on incrementing with every page refresh #310
Comments
I did some research and found below.
So, Commentting the version check and not providing version for NgxIndexedDBModule.forRoot(dbConfig) did the hack. // if (!dbConfig.version) { Although it works for me. I am open for elegant ways. Thank you! |
Hi @irsali, |
Similar thing is happening with me. When the app is opened in new tab of the same browser where it is already running, the version changes dynamically and any further transactions fails. Edit: Just found the bug in my code i guess? I used deleteObjectStore when i wanted to clear the data in indexedDB, seems like it causes the version change dynamically (maybe when there is no object store to delete) |
Hi @itzgauravsingla, |
Hi @irsali, thanks |
@aparzi If a user already have a db with different version as the config.. I am unable to delete the db as i am getting the same error of version mismatch. Is there anything I am missing? |
@itzgauravsingla As soon as possible I will do a check and see if it is possible to find a solution that would, in my opinion, go along with the concept of version integrity |
Hi @aparzi,
For 1st issue it is replicating in playground itself. Add one or more store then refresh browser and you see error like below: |
Hi @irsali, |
I will check them out calmly |
@irsali - funnily enough I'm encountering the same issue as you, in my case each "user" (browser) could have a different version depending on how many tables have been created, which happens dynamically depending on how many times user performs action X, so basically whatever number defined in the code config is going to be incorrect for someone (I would try it all in one table, however I need to clear items and purge the table sometimes, but not delete everything from the table i.e. user config while doing this).. tried your hack fix though and I'm still getting the exception about version not being supplied I don't know much about indexeddb but feels like I'm stuck in a catch 22 where config needs to be supplied to connect, but also need to retrieve the version number into the config to instantiate the connection 😭 |
Hi @0xrgg, |
Issue resolved with PR #434 |
I am calling createObjectStore of NgxIndexedDBService to dynamically add stores at runtime. It makes my declaration version of DBConfig behind the actual at any point of time. I guess, Due to this version mismatch, I could not find if this store is already exist.
Is there any way to provide current version for NgxIndexedDBModule.forRoot(dbConfig) ?
Also, Is there any way to find if particular store exist or not. For now, I am using my own fork with below code for this but wanted to be sure if there is any elegant way already exist that i missed.
The text was updated successfully, but these errors were encountered: