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-18140] Handle unknown SecureNoteTypeJson values #4745

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SaintPatrck
Copy link
Contributor

🎟️ Tracking

PM-18140

📔 Objective

The SecureNoteTypeJson serializer now defaults to GENERIC if an unknown value is received, as GENERIC is the only valid value.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation or informed the documentation team

🦮 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

The `SecureNoteTypeJson` serializer now defaults to `GENERIC` if an unknown value is received, as `GENERIC` is the only valid value.
Copy link
Contributor

Logo
Checkmarx One – Scan Summary & Detailsf7a8bc3d-dbac-42da-8960-61dba5dd50a0

Great job, no security vulnerabilities found in this Pull Request

Comment on lines +24 to +25
// Because GENERIC is the only valid value we default to it if an unknown value is received.
default = SecureNoteTypeJson.GENERIC,
Copy link
Contributor Author

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.

Copy link
Member

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 😄

Copy link

codecov bot commented Feb 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.34%. Comparing base (e929ca8) to head (6e974e4).
Report is 10 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

@SaintPatrck SaintPatrck added the hold do not merge yet label Feb 20, 2025
@SaintPatrck
Copy link
Contributor Author

Holding for Product review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hold do not merge yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants