@W-23146707: Loosen record-event event_type validation - #581
Open
jarhun88 wants to merge 2 commits into
Open
Conversation
Drop the .max(64) and SCREAMING_SNAKE_CASE regex on event_type so it accepts any string; keep the message 1024-char truncation. Removes the now-obsolete rejection test.
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.
Description
Follow-up to #530. Loosens validation on the
record-eventapp tool'sevent_typeparameter:.max(64)length cap and the SCREAMING_SNAKE_CASE regex (/^[A-Z][A-Z0-9_]*$/) fromevent_type— it now accepts any string.messagefield's 1024-char truncation unchanged.event_typevalues are rejected; positive and message-truncation tests remain.Motivation and Context
The regex/length constraints on
event_typewere stricter than the telemetry pipeline needs and risked rejecting valid client events at the schema boundary.event_typeis a free-form telemetry label; bounding it as a hard-validated field added friction without a corresponding safety benefit. Themessagetruncation is retained since it protects the telemetry payload size.Type of Change
How Has This Been Tested?
npx vitest run src/tools/web/recordEvent— 6 tests passnpx tsc --noEmit— cleannpx eslinton the changed files — cleanRelated Issues
Follow-up to #530.
Checklist
npm run version(3.5.3 → 3.5.4).