Skip to content

@W-23146707: Loosen record-event event_type validation - #581

Open
jarhun88 wants to merge 2 commits into
mainfrom
dev/feat/loosen-record-event-type
Open

@W-23146707: Loosen record-event event_type validation#581
jarhun88 wants to merge 2 commits into
mainfrom
dev/feat/loosen-record-event-type

Conversation

@jarhun88

Copy link
Copy Markdown
Contributor

Description

Follow-up to #530. Loosens validation on the record-event app tool's event_type parameter:

  • Removed the .max(64) length cap and the SCREAMING_SNAKE_CASE regex (/^[A-Z][A-Z0-9_]*$/) from event_type — it now accepts any string.
  • Kept the message field's 1024-char truncation unchanged.
  • Removed the now-obsolete test that asserted malformed event_type values are rejected; positive and message-truncation tests remain.

Motivation and Context

The regex/length constraints on event_type were stricter than the telemetry pipeline needs and risked rejecting valid client events at the schema boundary. event_type is a free-form telemetry label; bounding it as a hard-validated field added friction without a corresponding safety benefit. The message truncation is retained since it protects the telemetry payload size.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

How Has This Been Tested?

  • npx vitest run src/tools/web/recordEvent — 6 tests pass
  • npx tsc --noEmit — clean
  • npx eslint on the changed files — clean

Related Issues

Follow-up to #530.

Checklist

  • I have updated the version in the package.json file by using npm run version (3.5.3 → 3.5.4).
  • I have made any necessary changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have documented any breaking changes in the PR description.

jarhun88 added 2 commits July 21, 2026 18:38
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant