Enforce schema character set on vital.name in Operation APIs#3393
Enforce schema character set on vital.name in Operation APIs#3393Valpertui wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e336d9064
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
025047d to
16133cc
Compare
|
Please check #3390 and align with that, including using the new |
677c18e to
cc760e0
Compare
This comment has been minimized.
This comment has been minimized.
cc760e0 to
cfbaf27
Compare
ed09ae6 to
d56bd13
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The backend enforces [\w.@$-]* on vital.name via the vital-common-schema facet-path rule; until now the Android SDK only checked for blank names. This change validates the character set in featureOperationArgumentsValid: blank names are dropped with a WARN, names that fail the regex warn but are still emitted (backend is source of truth on the policy). operationKey has no schema character-set rule and is left untouched. Added VALID_OPERATION_NAME_REGEX and FO_ERROR_INVALID_NAME_CHARACTERS message.
d56bd13 to
90004e4
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3393 +/- ##
===========================================
+ Coverage 72.18% 72.20% +0.02%
===========================================
Files 964 964
Lines 35586 35588 +2
Branches 5928 5929 +1
===========================================
+ Hits 25687 25696 +9
+ Misses 8278 8277 -1
+ Partials 1621 1615 -6
🚀 New features to boost your workflow:
|
A blank/whitespace-only operationKey is optional metadata, so dropping the whole vital event over it loses a diagnostic data point for good. operationArgumentsValid now warns the developer and still emits, matching the cross-SDK warn-and-emit contract for malformed optional fields. Only a blank name stays a hard drop, since an unnamed step can't be correlated. Reworded OPERATION_ERROR_INVALID_OPERATION_KEY accordingly. Updated the three blank-key tests to assert the event is still produced alongside the WARN, and added an emoji operation-name test for surrogate-pair coverage.
bff5d45 to
59f3fb2
Compare
What does this PR do?
Validates
vital.nameclient-side in the Operation APIs (startOperation/succeedOperation/failOperation) against the backend's character-set regex[\w.@$-]*.InternalLogger.Level.WARN[\w.@$-]*→InternalLogger.Level.WARN, event still emittedoperationKeyhas no schema character-set rule and is left untouchedMotivation
The authoritative
_vital-common-schema.jsondocumentsvital.nameas restricted to letters, digits, and- _ . @ $— it is used as a facet path by the backend. Until now the Android SDK only checked for blank names; non-conforming values (e.g."user login") were silently shipped to intake, where they are rejected. Client-side validation gives developers immediate feedback at dev time.Names that fail the character-set regex still emit because the backend is the source of truth on the policy — a client-side drop would force customers to bump the SDK if the server rule is ever relaxed.
Additional Notes
internal:VALID_OPERATION_NAME_REGEXandOPERATION_ERROR_INVALID_NAME_CHARACTERS. No public API surface changes;api/apiSurfaceandapi/dd-sdk-android-rum.apido not need to be regenerated.java.util.regex.Pattern's default\wis ASCII-only (noUNICODE_CHARACTER_CLASSflag) — the non-ASCII test case"ログイン"pins this behavior against future drift.Review checklist (to be filled by reviewers)