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

fix: handle null items response #105

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ralphbean
Copy link
Member

Fixes

None on file.

Description

If you have access to zero workspaces, then it is possible for the /workspaces query to return null for the items instead of [].

This change handles that to return [] onto the call.

The app fails later where there is undefined behavior if the user cannot land on a workspace, but will deal with that in a later change.

Type of change

  • Feature
  • Bugfix
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Screen shots / Gifs for design review

None.

How to test or reproduce?

Try to use the UI pointed at the stage cluster, but with a user with no access to workspaces there.

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

If you have access to zero workspaces, then it is possible for the
/workspaces query to return `null` for the items instead of `[]`.

This change handles that to return `[]` onto the call.

The app fails later where there is undefined behavior if the user cannot
land on a workspace, but will deal with that in a later change.

Signed-off-by: Ralph Bean <[email protected]>
Copy link

codecov bot commented Feb 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.12%. Comparing base (c6528e9) to head (e46cad5).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #105      +/-   ##
==========================================
- Coverage   80.12%   80.12%   -0.01%     
==========================================
  Files         578      578              
  Lines       21554    21555       +1     
  Branches     5348     5350       +2     
==========================================
  Hits        17270    17270              
  Misses       4259     4259              
- Partials       25       26       +1     
Flag Coverage Δ
unittests 80.12% <ø> (-0.01%) ⬇️

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.

@ralphbean ralphbean requested a review from sahil143 February 6, 2025 21:25
@testcara
Copy link
Contributor

testcara commented Feb 7, 2025

LGTM

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