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

Ensure Pipelines don't fall over if Device Groups are unavailable #4975

Merged
merged 2 commits into from
Jan 3, 2025

Conversation

joepavitt
Copy link
Contributor

@joepavitt joepavitt commented Jan 3, 2025

Description

If Device Groups are not available to a Team, then the API returns a 404, in turn, this was causing the Pipelines (Create) page to fall over when trying to load the list of available Device Groups.

This PR puts in relevant catchers to ensure the page still loads

@ZJvandeWeg
Copy link
Member

Fundamentally I don't like swallowing errors and making them non-tracable. If it's a 404 code, I get it, but in that case can we check if statusCode >= 400 && statusCode < 500, and maybe console.log otherwise?

@joepavitt
Copy link
Contributor Author

Fair feedback - will make it so

Copy link

codecov bot commented Jan 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.43%. Comparing base (19a0a08) to head (8fc7d35).
Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4975   +/-   ##
=======================================
  Coverage   78.43%   78.43%           
=======================================
  Files         325      325           
  Lines       15353    15353           
  Branches     3530     3530           
=======================================
  Hits        12042    12042           
  Misses       3311     3311           
Flag Coverage Δ
backend 78.43% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@ZJvandeWeg ZJvandeWeg enabled auto-merge January 3, 2025 15:37
try {
this.deviceGroups = (await ApplicationApi.getDeviceGroups(this.application.id)).groups
} catch (err) {
if (err.request.status === 404) {
Copy link
Contributor Author

@joepavitt joepavitt Jan 3, 2025

Choose a reason for hiding this comment

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

@ZJvandeWeg I've handled it here now, will show an alert to the user if we see an error we aren't expecting

@ZJvandeWeg ZJvandeWeg merged commit 605d471 into main Jan 3, 2025
19 checks passed
@ZJvandeWeg ZJvandeWeg deleted the fix-pipelines-free-tier branch January 3, 2025 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants