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

refactor(worker): Remove redundant Bridge error handling #6875

Merged
merged 6 commits into from
Nov 13, 2024

Conversation

rifont
Copy link
Contributor

@rifont rifont commented Nov 6, 2024

What changed? Why was the change needed?

  • Fix the calculatedDelay computation to respect got needs to review the computedValue, ensuring that the retriable status codes and error codes are respected
  • Remove redundant bridge failure execution detail creation, as all failures are handled by the afterResponse hook

Screenshots

No retries for 400 error, execution logs now shows only 1 entry
image

No retries for 408 error, execution logs now shows only 1 entry
image

No retries for 502 error, execution logs now shows only 1 entry
image

Expand for optional sections

Related enterprise PR

Special notes for your reviewer

Copy link

netlify bot commented Nov 6, 2024

Deploy Preview for novu-stg-vite-dashboard-poc ready!

Name Link
🔨 Latest commit 06d9ec3
🔍 Latest deploy log https://app.netlify.com/sites/novu-stg-vite-dashboard-poc/deploys/67347db50763010008c62798
😎 Deploy Preview https://deploy-preview-6875--novu-stg-vite-dashboard-poc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@rifont rifont self-assigned this Nov 11, 2024
});

let raw = JSON.parse(executionDetailsRequired[0]?.raw ?? '');
let error = raw.raw.data[0].message;
let error = raw.data[0].message;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This raw.raw stutter was unnecessary and made the UI more difficult to read.

@@ -38,64 +38,68 @@ export const isRegularDigestOutput = (

export const BRIDGE_EXECUTION_ERROR = {
INVALID_BRIDGE_URL: {
code: 'INVALID_BRIDGE_URL',
code: 'InvalidBridgeUrl',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's easier to read a pascal-cased code on the UI, plus Framework uses PascalCase for all the error codes already and we should be consistent.

code: 'UnknownBridgeNonRequestError',
message: (url: string) =>
`Unknown bridge non-request error calling \`${url}\``,
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Making sure that unknown cases also have an error code to refer to.

hooks: {
afterResponse:
command.afterResponse !== undefined ? [command.afterResponse] : [],
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A step to move away from depending on the got interface for errors.

Copy link
Contributor

@djabarovgeorge djabarovgeorge left a comment

Choose a reason for hiding this comment

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

🚀

@rifont rifont merged commit bb667a6 into next Nov 13, 2024
35 checks passed
@rifont rifont deleted the simplify-bridge-execution-logs branch November 13, 2024 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants