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

[PM-6169] Explore potential approach for unknown value in enums #595

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Hinton
Copy link
Member

@Hinton Hinton commented Feb 9, 2024

Type of change

- [ ] Bug fix
- [ ] New feature development
- [x] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

We currently don't have a graceful way to handle server adding new enums to fields. Even though the enum might not be used in the SDK. This introduces a default value which allows the consumer to handle it instead.

Showcases two examples of how we might want to handle this:

  • crates/bitwarden/src/admin_console/policy.rs: Bubble up an error and silently discard invalid policies.
    -crates/bitwarden/src/vault/send.rs: Immediately exit execution since we currently require it. In the future this might be refactored to handle it more gracefully.

Code changes

  • file.ext: Description of what was changed and why

Before you submit

  • Please add unit tests where it makes sense to do so

@bitwarden-bot
Copy link

bitwarden-bot commented Feb 9, 2024

Logo
Checkmarx One – Scan Summary & Details395b93df-7b21-4c67-871e-feb480495ad4

No New Or Fixed Issues Found

@Hinton Hinton changed the title Explore potential approach for unknown value in enums [PM-6169] Explore potential approach for unknown value in enums Feb 9, 2024
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.

None yet

2 participants