-
Notifications
You must be signed in to change notification settings - Fork 23
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
#9221: Attach db name and operation name to idb errors #9223
#9221: Attach db name and operation name to idb errors #9223
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.
Tests copied from logging.test.ts
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.
Extracted from logging.ts for reuse
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9223 +/- ##
==========================================
+ Coverage 74.24% 74.81% +0.56%
==========================================
Files 1332 1367 +35
Lines 40817 42139 +1322
Branches 7634 7879 +245
==========================================
+ Hits 30306 31526 +1220
- Misses 10511 10613 +102 ☔ View full report in Codecov by Sentry. |
Playwright test resultsDetails Open report ↗︎ Flaky testschrome-setup › setup/affiliated.setup.ts › authenticate with affiliated user Skipped testschrome › tests/regressions/doNotCloseSidebarOnPageEditorSave.spec.ts › #8104: Do not automatically close the sidebar when saving in the Page Editor |
// Rather than use reportError from @/telemetry/reportError, IDB errors are directly reported | ||
// to application error telemetry to avoid attempting to record the error in the idb log database. |
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 was the case with errors that got thrown when writing to the idb LOG database, but I think that we probably should call the normal reportError when writing to the other dbs so that if the error is related to a mod run it will get recorded in the idb log database.
To handle this we could consider defining an optional reportError param that defaults to using reportError and we can override that for the logging db operations.
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.
I agree, but we would need to refactor the report functions. It's not worth the added effort right now. We're not catching the errors that we're using to make reportToApplicationErrorTelemetry
calls, so the error will still be reported to the error service and the logging idb
src/utils/idbUtils.ts
Outdated
| ValueOf<typeof IDB_OPERATION.LOG> | ||
| ValueOf<typeof IDB_OPERATION.TRACE> | ||
| ValueOf<typeof IDB_OPERATION.PACKAGE_REGISTRY>; |
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.
nit: there is probably a more terse way to write this, but this is probably fine. Maybe consider defining a type for this.
Another way to write this:
ValueOf<
| typeof IDB_OPERATION.LOG
| typeof IDB_OPERATION.TRACE
| typeof IDB_OPERATION.PACKAGE_REGISTRY
>;
PACKAGE_REGISTRY: "BRICK_REGISTRY", | ||
} as const; | ||
|
||
export const IDB_OPERATION = { |
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.
We might want to consider defining the common operations as helper methods in this file like count and recreateDB
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.
I don't disagree. But I think we should do that as a separate PR if that's a path we want to go down
src/utils/idbUtils.ts
Outdated
} as const; | ||
|
||
export const IDB_OPERATION = { | ||
LOG: { |
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.
nit: you could make this refer to the const you defined above for stricter typing:
[DATABASE_NAME.LOG]: {
...
Some functions were used in features or returned a value in which case they were not swallowed. In cases were we returning void, and didn't care if the function was successful, we swallowed the error. |
@@ -64,7 +64,7 @@ export class ModsPage extends BasePageObject { | |||
.waitForEvent("requestfinished", { | |||
predicate: (request) => | |||
request.url().includes(API_PATHS.REGISTRY_BRICKS), | |||
timeout: 15_000, | |||
timeout: 30_000, |
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.
Can we create a github issue for this and link it in an inline comment?
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. |
What does this PR do?
Discussion
logging.ts
, we swallow some of the errors but not othersFor more information on our expectations for the PR process, see the
code review principles doc