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

Add idb error handling for Internal error opening backing store #9252

Merged
merged 4 commits into from
Oct 8, 2024

Conversation

fungairino
Copy link
Collaborator

@fungairino fungairino commented Oct 8, 2024

What does this PR do?

Discussion

Checklist

Leave all that are relevant and check off as completed

  • This PR requires a security review
  • This PR introduces a new library: double check it's MIT/Apache2/permissively licensed
  • This PR requires a node/npm version update: let the team know on #engineering
  • This PR requires a documentation change (link to old docs)
  • This PR requires a tutorial update (link to old tutorials)
  • This PR requires a feature flag
  • This PR requires a environment variable change
  • Added jest or playwright tests and/or storybook stories

For more information on our expectations for the PR process, see the
code review principles doc

@@ -150,6 +169,10 @@ export function isMaybeTemporaryIDBError(error: unknown): boolean {
return isIDBConnectionError(error) || isIDBLargeValueError(error);
}

export function isPermanentIDBError(error: unknown): boolean {
Copy link
Contributor

@twschiller twschiller Oct 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first glance, this check seems inconsistent with isMaybeTemporaryIDBError given that isIDBConnectionError checks for a very similar message: https://github.com/pixiebrix/pixiebrix-extension/pull/9252/files#diff-ac059c8d1b896fde28f537e24bb46cd62088057e599d99dde3d9152d17fa3f8eR28

Do we know what's going on with the different capitalization/etc. in those messages?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have enough context on the "Error Opening IndexedDB". Doing a quick search I can't find anything regarding this specific error and looking at the git history, it points to an old rollbar log link.

Maybe you could tell me more about this connection error message?
75bb247#diff-ac059c8d1b896fde28f537e24bb46cd62088057e599d99dde3d9152d17fa3f8eR5-R7

Copy link

codecov bot commented Oct 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.10%. Comparing base (8318d74) to head (72c7d1c).
Report is 350 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9252      +/-   ##
==========================================
+ Coverage   74.24%   75.10%   +0.86%     
==========================================
  Files        1332     1370      +38     
  Lines       40817    42300    +1483     
  Branches     7634     7890     +256     
==========================================
+ Hits        30306    31771    +1465     
- Misses      10511    10529      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@twschiller twschiller added bug Something isn't working runtime labels Oct 8, 2024
Copy link

github-actions bot commented Oct 8, 2024

Playwright test results

passed  135 passed
flaky  3 flaky
skipped  4 skipped

Details

report  Open report ↗︎
stats  142 tests across 46 suites
duration  13 minutes
commit  72c7d1c
info  For more information on how to debug and view this report, see our readme

Flaky tests

chrome › tests/pageEditor/addStarterBrick.spec.ts › Add starter brick to mod
msedge › tests/pageEditor/addStarterBrick.spec.ts › Add starter brick to mod
msedge › tests/regressions/hideModalsOnPageEditorRefresh.spec.ts › should hide add brick modal when Page Editor refreshes

Skipped tests

chrome › tests/regressions/doNotCloseSidebarOnPageEditorSave.spec.ts › #8104: Do not automatically close the sidebar when saving in the Page Editor
msedge › tests/regressions/doNotCloseSidebarOnPageEditorSave.spec.ts › #8104: Do not automatically close the sidebar when saving in the Page Editor
chrome › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options
msedge › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options

@@ -138,6 +142,21 @@ export function isIDBLargeValueError(error: unknown): boolean {
return message.includes("Failed to read large IndexedDB value");
}

/**
* Corrupt chrome profile. Not sure how this happens, but it seems to happen to users
* on citrix machines. This error seems to be unrecoverable and the only solution is to
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not just citrix. We've seen this on other devices as well. It's even happened to me on my Mac, though not in a long time

@@ -150,6 +169,10 @@ export function isMaybeTemporaryIDBError(error: unknown): boolean {
return isIDBConnectionError(error) || isIDBLargeValueError(error);
}

function isPermanentIDBError(error: unknown): boolean {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're probably better off leaving these as separate checks at the callsite

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, we could name it something like shouldDeleteDatabaseOnAllRetriesFailed

Copy link

github-actions bot commented Oct 8, 2024

No loom links were found in the first post. Please add one there if you'd like to it to appear on Slack.

Do not edit this comment manually.

@grahamlangford grahamlangford merged commit 7952c3d into main Oct 8, 2024
23 checks passed
@grahamlangford grahamlangford deleted the idb-error-opening-store branch October 8, 2024 17:54
@mnholtz mnholtz added this to the 2.1.4 milestone Oct 8, 2024
grahamlangford pushed a commit that referenced this pull request Oct 8, 2024
* Add idb error handling for Internal error opening backing store

* knip

* pr feedback

* update comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working runtime
Development

Successfully merging this pull request may close these issues.

4 participants