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

dexie-export-import exports corrupt blobs #1962

Open
zewt opened this issue Apr 20, 2024 · 0 comments
Open

dexie-export-import exports corrupt blobs #1962

zewt opened this issue Apr 20, 2024 · 0 comments

Comments

@zewt
Copy link

zewt commented Apr 20, 2024

I'm getting corrupt blobs from dexie-export-import:

https://gist.github.com/zewt/0ef5e39c535c3ab7abbd6b855dab9a92

This exports two rows, one with "1234" and one with "abcd". The exported data looks like "MTIzNGFiY2Q=", which is "1234abcd".

This looks like where the broken data is created:

https://github.com/dexie/Dexie.js/blob/master/addons/dexie-export-import/src/tson.ts#L73

        typeSpec.finalize(b, allChunks.slice(b.start, b.end));

b looks like { type: { mime", data: { start: 100, end: 200 } }, so this calls slice(undefined, undefined), which just makes a copy of allChunks.

(Tangentally, I'm confused at the global state in blobsToAwait. Wouldn't this corrupt exports if multiple databases are exported in parallel?)

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

1 participant