-
Notifications
You must be signed in to change notification settings - Fork 849
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-18140] Handle unknown SecureNoteTypeJson values #4745
base: main
Are you sure you want to change the base?
Conversation
The `SecureNoteTypeJson` serializer now defaults to `GENERIC` if an unknown value is received, as `GENERIC` is the only valid value.
Great job, no security vulnerabilities found in this Pull Request |
// Because GENERIC is the only valid value we default to it if an unknown value is received. | ||
default = SecureNoteTypeJson.GENERIC, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vvolkgang @fedemkr Thoughts on defaulting this to GENERIC
? It's a little heavy handed, but GENERIC
is the only known valid note type. This not only fixes deserialization in the client, but it also corrects the record if the user updates the item.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the current state of all clients/server I think it's safe to do so. However, we need to keep this in mind if the SecureNoteType
were to add any more values in the future which could break some logic so I'd ask internally if there are any plans on adding more types in the near/mid term future; if not I'd say go for it 😄
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4745 +/- ##
=======================================
Coverage 89.34% 89.34%
=======================================
Files 490 490
Lines 41323 41323
Branches 5880 5880
=======================================
Hits 36920 36920
Misses 2373 2373
Partials 2030 2030 ☔ View full report in Codecov by Sentry. |
Holding for Product review |
🎟️ Tracking
PM-18140
📔 Objective
The
SecureNoteTypeJson
serializer now defaults toGENERIC
if an unknown value is received, asGENERIC
is the only valid value.⏰ 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 confirmedissue 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