[PM-33319] Rename ty field of Unknown variant#125
Merged
Hinton merged 2 commits intobitwarden:mainfrom Mar 10, 2026
Merged
Conversation
If we failed to deserialize a credential, serde's last attempt will be the Unknown variant. The Unknown variant currently requires the object to have a `ty` property, which in most cases isn't true because most providers will include a `type` property with their credential objects. With this rename we are ensuring that Unknown is correctly chosen if the object has a valid `type` property, and none of the other variants work out. Note, this still won't handle cases where `type` is missing.
|
Thank you for your contribution! We've added this to our internal tracking system for review. Details on our contribution process can be found here: https://contributing.bitwarden.com/contributing/pull-requests/community-pr-process. |
Hinton
previously approved these changes
Mar 10, 2026
Member
Hinton
left a comment
There was a problem hiding this comment.
Nice, would you mind adding a note to the changelog?
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #125 +/- ##
=======================================
Coverage ? 63.30%
=======================================
Files ? 5
Lines ? 545
Branches ? 0
=======================================
Hits ? 345
Misses ? 200
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
Sure can! Let me know if you're happy with the message |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If we failed to deserialize a credential, serde's last attempt will be the Unknown variant. The Unknown variant currently requires the object to have a
typroperty, which in most cases isn't true because most providers will include atypeproperty with their credential objects. With this rename we are ensuring that Unknown is correctly chosen if the object has a validtypeproperty, and none of the other variants work out.Note, this still won't handle cases where
typeis missing.🎟️ Tracking
📔 Objective
I noticed that we fail to deserialize to unknown when a provider gets the format wrong. With this patch we are correctly deserializing to Unknown.
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:) or similar for great changes:memo:) or ℹ️ (:information_source:) for notes or general info:question:) for questions:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:) for suggestions / improvements:x:) or:warning:) for more significant problems or concerns needing attention:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt:pick:) for minor or nitpick changes