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

Improve debugging experience #1879

Merged
merged 4 commits into from
Feb 7, 2024
Merged

Conversation

dfahlander
Copy link
Collaborator

  • Use Chrome's Async Task Tagging API to track failing operations down to the app code that initiated the operation.
  • Fail fast on table.get(undefined)
  • Remove old "long stacks" support that was tailored for older browsers and have no gain anymore.

It's a common pitfall to do db.someTable.get(someVariable) without checking that someVariable isn't null.

This is a common pitfall and in the case the call to Table.get() is the initial db call that the application makes, the call stack will be totally unreadable because:

1. Table.get() will first asynchronically auto-open the database.
2. Whe DB is finally opened it will fail deep inside DBCore leaving the user with an unreadable call stack.

See #1806 (comment)
…k() instead.

We used to have own special support for long async stacks to simplify debugging. However, now all browsers already have long async stacks supported in devtools.
This commit removes all special code that deals with long stack support.
It also introduces the usage of Chrome's Async Stack Tagging API (console.createTask()) that makes it easier to follow console traces on exceptions and find the application code that initiated the operation.

Also, when Dexie.debug is true, we trace all errors from dexie operations with the help of async stack tagging, hopefully making it easier for app developers to find issues in app code.

See #1806
@dfahlander dfahlander merged commit e8ecb84 into master Feb 7, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

1 participant