Skip to content
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

Safari IndexedDb duplicate db #72

Closed
honia19 opened this issue Dec 3, 2018 · 8 comments
Closed

Safari IndexedDb duplicate db #72

honia19 opened this issue Dec 3, 2018 · 8 comments

Comments

@honia19
Copy link

honia19 commented Dec 3, 2018

I created issue on stackoverflow link with screenshort
This bug reproduce only in Safari
https://stackoverflow.com/questions/53560736/indexeddb-duplicate-only-in-safari
Code:

    Idb.initDb()
        .then(isUpdate => {
                console.log(isUpdate);
            }
        ).catch((error) => {
        console.log(error);
    });

    static initDb = async () => {
        const db = await idb.open(dbState.name, dbState.version, (upgradeDB) => {
            dbState.stores.forEach((store) => {
                if (!upgradeDB.objectStoreNames.contains(store)) {
                    upgradeDB.createObjectStore(store);
                    console.log('The store -', store, ' was added to db');
                }
            })
        });
    };
@vishnumanjunath
Copy link

Same issue, when you navigate to different website and come back it creates duplicate DB.

@ywen
Copy link

ywen commented Aug 20, 2019

The issue doesn't seem to be specific to this library. I use Dexie and the same problem appears

@mlrv
Copy link
Contributor

mlrv commented Apr 2, 2020

Is there any update on this? I'm seeing the same issue, just on Safari

@jakearchibald
Copy link
Owner

I suspect this is a Safari bug rather than anything to do with this library, but if someone can come up with a minimal reproduction and steps, I can take a look.

@mlrv
Copy link
Contributor

mlrv commented Apr 2, 2020

I suspect this is a Safari bug rather than anything to do with this library, but if someone can come up with a minimal reproduction and steps, I can take a look.

Hey @jakearchibald, thanks for the swift response. I also believe this is a Safari bug and has nothing to do with idb itself. It might also be just a UI bug and the browser isn't actually creating multiple databases (it should also be impossible to create two dbs with the same name I assume?), I'll see if I can find out more.

@jakearchibald
Copy link
Owner

Yeah, databases are unique per name per origin.

If there isn't any data loss associated with this, then I suspect it's just a UI bug. I guess you could look into the profile and if the information is actually duplicated.

@sachinrekhi
Copy link

I'm seeing the exact same duplicate IndexedDB issue with Safari 13.1.1 on Mac 10.15.5. My guess though is that it's an issue with Safari's IDB browser, because when I make a change to a key, that change is reflected in both versions of the databases shown in the browser, suggesting they are actually the same underlying data, not in-fact two separate databases.

@jakearchibald
Copy link
Owner

Please reopen this with a minimal reproduction, if you think it's an issue with the library rather than an issue with Safari.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants