gitpod icon indicating copy to clipboard operation
gitpod copied to clipboard

Fix active state for the selected billing team in billing settings

Open gtsiolis opened this issue 3 years ago • 1 comments

Bug description

Following up from https://github.com/gitpod-io/gitpod/pull/11777, there's a bug in selecting a team for usage attribution when having multiple teams with active UBP billing enabled. Cc @jankeromnes

https://user-images.githubusercontent.com/120486/183431301-7fe471a2-914b-499c-8c01-fcde0fa49a28.mov

Steps to reproduce

  1. Enable UBP billing for more than one team
  2. Try selecting that team in billing settings

Workspace affected

No response

Expected behavior

No response

Example repository

No response

Anything else?

No response

gtsiolis avatar Aug 08 '22 13:08 gtsiolis

Excellent catch! Many thanks for filing this issue @gtsiolis 🙏

There is even a second bug in this active state -- when the user hasn't made an explicit choice, the default-selected item does not reflect what the workspace-start logic would select -- for example:

  • User is part of Team A, which has usage-based billing enabled
  • User has not made a specific choice yet (i.e. in the DB, user.usageAttributionId is still undefined)
  • The UI shows (myself) (i.e. the User) as selected by default ❌
  • The workspace-start logic will see that there is only one team with billing enabled, so it will pick Team A by default ✅

In the above case, the UI should show Team A as selected by default.

jankeromnes avatar Aug 08 '22 13:08 jankeromnes