Skip to content

fix: handle null items response #105

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

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

ralphbean
Copy link
Member

@ralphbean ralphbean commented Feb 6, 2025

Fixes

fixes #16

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 <rbean@redhat.com>
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).
Report is 7 commits behind head on main.

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
Member

testcara commented Feb 7, 2025

LGTM

@sahil143
Copy link
Member

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.

The unintended behavior will be addressed by migrating to namespaces. We will implement a list page that displays an empty state, along with instructions on how to gain access to a namespace.

@sahil143 sahil143 merged commit 591f649 into konflux-ci:main Feb 10, 2025
5 checks passed
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.

Unexpected Application Error! result.items is null
3 participants