-
Notifications
You must be signed in to change notification settings - Fork 4k
Fix typo #3823
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
base: master
Are you sure you want to change the base?
Fix typo #3823
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR corrects terminology inconsistencies in the IndexedDB documentation regarding microtasks vs macrotasks and their relationship to transaction auto-commit behavior.
- Corrects the description of when IndexedDB transactions auto-commit (macrotasks queue instead of microtasks queue)
- Fixes the classification of
fetchas a microtask instead of macrotask - Updates the explanation of transaction timing behavior to use consistent terminology
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| ``` | ||
|
|
||
| That's because `fetch` is an asynchronous operation, a macrotask. Transactions are closed before the browser starts doing macrotasks. | ||
| That's because `fetch` is an asynchronous operation, a microtask. Transactions are closed before the browser starts doing microtasks. |
Copilot
AI
Sep 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is incorrect. fetch is a macrotask, not a microtask. The original text was correct - fetch creates a macrotask and transactions are closed before macrotasks execute.
| That's because `fetch` is an asynchronous operation, a microtask. Transactions are closed before the browser starts doing microtasks. | |
| That's because `fetch` is an asynchronous operation, a macrotask. Transactions are closed before the browser starts doing macrotasks. |
| ### "Inactive transaction" pitfall | ||
|
|
||
| As we already know, a transaction auto-commits as soon as the browser is done with the current code and microtasks. So if we put a *macrotask* like `fetch` in the middle of a transaction, then the transaction won't wait for it to finish. It just auto-commits. So the next request in it would fail. | ||
| As we already know, a transaction auto-commits as soon as the browser is done with the current code and macrotasks. So if we put a *microtask* like `fetch` in the middle of a transaction, then the transaction won't wait for it to finish. It just auto-commits. So the next request in it would fail. |
Copilot
AI
Sep 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change introduces an error. fetch is a macrotask, not a microtask. The sentence should read 'So if we put a macrotask like fetch' to be technically accurate.
| As we already know, a transaction auto-commits as soon as the browser is done with the current code and macrotasks. So if we put a *microtask* like `fetch` in the middle of a transaction, then the transaction won't wait for it to finish. It just auto-commits. So the next request in it would fail. | |
| As we already know, a transaction auto-commits as soon as the browser is done with the current code and macrotasks. So if we put a *macrotask* like `fetch` in the middle of a transaction, then the transaction won't wait for it to finish. It just auto-commits. So the next request in it would fail. |
Standard only state that auto-commit happen after requests finished and results handled.
Results handle by related events so implementation might wait for event queue to be empty.
from indexeddb api 2.0