Skip to content

fix(lightspeed): add return statement to address unhandled error in /v1/feedback #3070

Merged
Jdubrick merged 3 commits intoredhat-developer:mainfrom
Jdubrick:fix-lightspeed-feedback-error-handling
May 8, 2026
Merged

fix(lightspeed): add return statement to address unhandled error in /v1/feedback #3070
Jdubrick merged 3 commits intoredhat-developer:mainfrom
Jdubrick:fix-lightspeed-feedback-error-handling

Conversation

@Jdubrick
Copy link
Copy Markdown
Contributor

@Jdubrick Jdubrick commented May 7, 2026

Hey, I just made a Pull Request!

✔️ Checklist

Adds a return statement to the /v1/feedback handler when it gets a 500 error, it was the only one missing this out of all the route handlers.

Issue: https://redhat.atlassian.net/browse/RHIDP-13063

  • A changeset describing the change and affected packages. (more info)
  • Added or Updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)

@rhdh-qodo-merge
Copy link
Copy Markdown

rhdh-qodo-merge Bot commented May 7, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Qodo Logo

@rhdh-gh-app
Copy link
Copy Markdown

rhdh-gh-app Bot commented May 7, 2026

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-lightspeed-backend workspaces/lightspeed/plugins/lightspeed-backend patch v2.6.6

@rhdh-qodo-merge
Copy link
Copy Markdown

Review Summary by Qodo

Fix unhandled error in lightspeed /v1/feedback handler

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Add missing return statement in /v1/feedback error handler
• Prevents unhandled error fallthrough after 500 response
• Add test case for upstream server error handling
Diagram
flowchart LR
  A["POST /v1/feedback"] --> B["Upstream 500 Error"]
  B --> C["Send 500 Response"]
  C --> D["Add return statement"]
  D --> E["Prevent Fallthrough"]
Loading

Grey Divider

File Changes

1. workspaces/lightspeed/plugins/lightspeed-backend/src/service/router.ts 🐞 Bug fix +2/-0

Add return statement to error handler

• Add return statement after error response in /v1/feedback handler
• Prevents code execution from continuing after error response is sent
• Ensures proper error handling flow for upstream 500 errors

workspaces/lightspeed/plugins/lightspeed-backend/src/service/router.ts


2. workspaces/lightspeed/plugins/lightspeed-backend/src/service/router.test.ts 🧪 Tests +34/-0

Add upstream server error test case

• Add new test case for upstream server error handling
• Mock 500 error response from lightspeed-core server
• Verify proper status code and error message in response

workspaces/lightspeed/plugins/lightspeed-backend/src/service/router.test.ts


3. workspaces/lightspeed/.changeset/shiny-foxes-film.md 📝 Documentation +5/-0

Add changeset for error handler fix

• Create changeset documenting the bug fix
• Mark as patch version bump for lightspeed-backend plugin
• Describe fix for unhandled error in /v1/feedback handler

workspaces/lightspeed/.changeset/shiny-foxes-film.md


Grey Divider

Qodo Logo

@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 57.28%. Comparing base (fc38238) to head (2d573c9).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3070   +/-   ##
=======================================
  Coverage   57.28%   57.28%           
=======================================
  Files        2067     2067           
  Lines       63528    63529    +1     
  Branches    16583    16585    +2     
=======================================
+ Hits        36390    36395    +5     
+ Misses      26704    26700    -4     
  Partials      434      434           
Flag Coverage Δ *Carryforward flag
adoption-insights 83.58% <ø> (ø) Carriedforward from fc38238
ai-integrations 70.03% <ø> (ø) Carriedforward from fc38238
app-defaults 69.60% <ø> (ø) Carriedforward from fc38238
augment 69.36% <ø> (ø) Carriedforward from fc38238
bulk-import 72.44% <ø> (ø) Carriedforward from fc38238
cost-management 16.49% <ø> (ø) Carriedforward from fc38238
dcm 32.85% <ø> (ø) Carriedforward from fc38238
extensions 61.71% <ø> (ø) Carriedforward from fc38238
global-floating-action-button 73.75% <ø> (ø) Carriedforward from fc38238
global-header 61.68% <ø> (ø) Carriedforward from fc38238
homepage 50.92% <ø> (ø) Carriedforward from fc38238
konflux 91.01% <ø> (ø) Carriedforward from fc38238
lightspeed 70.00% <80.00%> (+0.07%) ⬆️
mcp-integrations 81.59% <ø> (ø) Carriedforward from fc38238
orchestrator 34.80% <ø> (ø) Carriedforward from fc38238
quickstart 62.64% <ø> (ø) Carriedforward from fc38238
sandbox 79.56% <ø> (ø) Carriedforward from fc38238
scorecard 83.61% <ø> (ø) Carriedforward from fc38238
theme 64.54% <ø> (ø) Carriedforward from fc38238
translations 8.49% <ø> (ø) Carriedforward from fc38238
x2a 17.29% <ø> (ø) Carriedforward from fc38238

*This pull request uses carry forward flags. Click here to find out more.


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc38238...2d573c9. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@gabemontero gabemontero left a comment

Choose a reason for hiding this comment

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

one question (answers might lead to an actual ask for change)

Jdubrick added 3 commits May 7, 2026 16:06
…handled error

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
@Jdubrick Jdubrick force-pushed the fix-lightspeed-feedback-error-handling branch from b3589db to 2d573c9 Compare May 7, 2026 20:06
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 7, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
8.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@Jdubrick Jdubrick requested a review from gabemontero May 7, 2026 20:44
Copy link
Copy Markdown
Contributor

@gabemontero gabemontero left a comment

Choose a reason for hiding this comment

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

lgtm

@Jdubrick Jdubrick merged commit 02f64dc into redhat-developer:main May 8, 2026
61 of 62 checks passed
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.

2 participants