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

Native promises don't always work inside a transaction on Safari #938

Open
nbrustein opened this issue Nov 19, 2019 · 3 comments
Open

Native promises don't always work inside a transaction on Safari #938

nbrustein opened this issue Nov 19, 2019 · 3 comments

Comments

@nbrustein
Copy link

I'm running into a case where, using a native promise inside of a transaction, I hit a TransactionInactiveError in Safari Desktop, but not Chrome or iOS Safari.

It's kind of difficult to come up with simple reproduction steps, though I can try to do so here if that would be helpful. Before I do that though, I wanted to ask about the comment on line 37 of this test file. The test is "Transaction should work when returning native Promise in transaction scope" and the comment says // Will only work on Chrome, Opera and Edge as of Oktober 6, 2016.)

Is there an undocumented issue with native promises inside browsers other than those listed there?

@nbrustein
Copy link
Author

I also found this related issue but it seems to suggest that native promises should be working fine in Safari. Am I understanding that correctly?

@dfahlander
Copy link
Collaborator

They should work in Safari nowadays, and had for a few years. The particular test you reference is successfully run on every commit on a Safari 12.1 browser, using BrowserStack, so the comment is not valid for Safari anymore.

However I recall there was at some point, an issue in the very start of a transaction, before any operation had taken place, if in the then-handler of a resolved promise (one microtick has ran) the transaction could be gone. For example, if starting a transaction block with awaiting Promise.resolve("foo") before doing the initial operation, that has historically been a situation that had been a problem in idb transactions.

@bwindels
Copy link

bwindels commented Mar 4, 2021

I know it's been a while since this was filed, but have been looking into a very similar issue on Safari and managed to extract a test case to detect the bug. I've filed https://bugs.webkit.org/show_bug.cgi?id=222746. Thought it might be of interest, as this ticket was one of the few hits I got when looking for information about the bug.

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

3 participants