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

When will dexie support relaxed durability transactions #1018

Open
kasnihuang opened this issue Apr 13, 2020 · 2 comments
Open

When will dexie support relaxed durability transactions #1018

kasnihuang opened this issue Apr 13, 2020 · 2 comments
Labels

Comments

@kasnihuang
Copy link

Chrome Exposes an optional relaxedDurability parameter on IDBDatabase.transaction to control flushing to disk. And will available at 83.
How long will Deixe support this feature after the 83 version is released?
https://chromestatus.com/feature/5730701489995776

@dfahlander
Copy link
Collaborator

Firefox uses relaxed durability in all IDB transactions without opting in to it, while Chrome and other browsers uses strict durability. Now Chrome wants to enable relaxed durability as an opt-in. From a developers point of view, it would be nice if the behavior could be same along implementations and that it would have the same default value.

For now, Dexie does not specify the {relaxedDurability: true} (as it seems to be named when looking at the C++ changes in chromium) option when we create a transaction. But if we would support it, I would suggest that transactions by default would have relaxedDurability turned on, and that it could be possible to force strict durability by explicitly turning it off, and that this would work the same across browsers. One idea would be to introduce the "d" letter in the Dexie-style transaction mode. A transaction could be marked "rwd", which would specify {relaxedDurability: false} as IDBTransactionOptions, while unless "d" is among the transaction mode, we'd use {relaxedDurability: true} by default. This would probably be ignored in browsers where the transaction options are not supported.

So for Dexie, this could be a two-step feature:

Step 1: Start specifying {relaxedDurability: true} on all transactions. Will only be used by chrome 83 and later. All others would ignore it. Firefox would use relaxed durability anyway.

Step 2: Allow explicit durable transactions, by introducting the "d" letter in dexie's transaction mode. This would only be respected by chrome 83 and later, and maybe also in a later version of Firefox if they want to go for it. Safari would keep using durable transactions in all cases unless they also want to use the flag.

@alyssaruth
Copy link
Contributor

This is now possible per #1367, and has been released in 3.2.0-beta.3.

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

No branches or pull requests

3 participants