Files
calendar/apps/web/playwright
Pedro CastroGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
c43c48b1a8 fix: add input validation to analytics app schemas (#26976)
* fix(analytics): add input validation to analytics app schemas

Add strict input validation for tracking IDs and URLs in analytics
app integrations to ensure data conforms to expected formats

* fix: remove optional/default to fix type inference

Remove .optional() and .default("") from schemas with transform/refine
chains to preserve correct TypeScript type inference

* fix: restore .optional() for type compatibility

* fix(e2e): use valid GTM container ID format in analytics test

Co-Authored-By: pedro@cal.com <pedro.castro@ideware.com.br>

* fix(analytics): address Cubic AI review feedback

- Tighten Meta Pixel ID regex from {1,20} to {15,16} digits (confidence 9.5/10)
- Fix PostHog error message to mention underscores are allowed (confidence 9/10)

Co-Authored-By: unknown <>

* fix(analytics): enforce domain label boundaries and prevent consecutive dots

Co-Authored-By: pedro@cal.com <pedro.castro@ideware.com.br>

* refactor: extract shared validation schemas

- Create analytics-schemas.ts with reusable safeUrlSchema, alphanumericIdSchema, and numericIdSchema
- Update databuddy, insihts, matomo, plausible, posthog, and umami to use shared schemas
- Keep app-specific schemas local (domain validation, UUID patterns, etc.)

* fix(analytics): enforce exactly 10 characters for GA4 Measurement ID

Tighten GA4 regex from {1,20} to {10} to match the documented format
G-XXXXXXXXXX. This addresses Cubic AI review feedback (confidence 9/10)
that the regex was too permissive compared to the error message.

Co-Authored-By: unknown <>

* refactor: add createPrefixedIdSchema factory for GTM/GA4/Fathom

- Add factory function to handle prefixed IDs with configurable options
(prefix, addPrefixIfMissing, allowEmpty)
- Consolidate GTM, GA4, and Fathom schemas using the shared factory
- Standardize imports to use @calcom/app-store alias

* fix: reject prefix-only IDs like "G-" or "GTM-" without content

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-02-02 14:19:43 -03:00
..
2026-01-02 12:47:00 +00:00
2026-01-13 00:56:08 -05:00