-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
chore: Convert ErrorReporting to a Service to use DI. Add some tests (no-changelog) #11279
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.
🙏🏻
packages/cli/src/error-reporting.ts
Outdated
) {} | ||
|
||
async init() { | ||
if (this.initialized) return; |
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.
Should we throw instead? We should prevent multiple init
calls from existing.
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.
not sure. if you tell me that we should throw here, then I'll update this.
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.
What makes you doubt? My reasoning is that initializing this twice means a developer error, so we could have an assertion error enforcing this. From what I see init
is called only from BaseCommand
.
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.
should we instead just remove the initialized
flag, since there is only one place calling init
? we don't do this for most other singleton in the system.
e16b6ce
to
2a970df
Compare
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
n8n Run #8289
Run Properties:
|
Project |
n8n
|
Branch Review |
PAY-2113-error-reporter-di
|
Run status |
Passed #8289
|
Run duration | 04m 36s |
Commit |
2a970dff1c: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 netroy 🗃️ e2e/*
|
Committer | कारतोफ्फेलस्क्रिप्ट™ |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
1
|
Pending |
0
|
Skipped |
0
|
Passing |
480
|
View all changes introduced in this branch ↗︎ |
✅ All Cypress E2E specs passed |
Got released with |
PAY-2113
Review / Merge checklist