From b7e668217d4a846b01a1333a57231d24e0e2f033 Mon Sep 17 00:00:00 2001 From: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Date: Thu, 4 Sep 2025 21:47:30 +0530 Subject: [PATCH] fix: make sure the email is in lowercase when updating profile (#23568) * feat: add zod schema for app metadata in config.json files - Create AppMetaSchema in packages/types/ that validates config.json structure against App interface - Integrate schema validation into build system's forEachAppDir function - Add support for all app variants including messaging, analytics, etc. - Validation failures show as warnings to maintain backward compatibility - Export schema from packages/types/index.ts for reuse - All existing config.json files now validate successfully Co-Authored-By: anik@cal.com * fix: remove validation logs and throw errors for invalid config.json files - Remove success log for validated config.json files - Throw validation errors instead of warnings with fallback - Addresses PR feedback on #23568 Co-Authored-By: anik@cal.com * fix: restore try-catch block with error throwing for config validation - Keep try-catch structure for proper error handling - Remove success console.log as originally requested - Throw descriptive errors instead of console.warn - Addresses PR feedback to maintain error handling while stopping build on validation failures Co-Authored-By: anik@cal.com * fix: address CodeRabbit feedback - add passthrough and improve error handling - Add .passthrough() to AppMetaSchema and nested objects for backward compatibility - Wrap JSON.parse in try-catch with better error messages including file paths - Preserve unknown keys in config.json files to avoid breaking existing functionality - Addresses CodeRabbit review comments on #23568 Co-Authored-By: anik@cal.com * refactor: remove index.ts and use direct import for AppMetaSchema - Remove packages/types/index.ts file as requested - Import AppMetaSchema directly from AppMetaSchema.ts file - Simplifies import structure while maintaining functionality - All config.json validation still works correctly Co-Authored-By: anik@cal.com * fix --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- apps/web/modules/settings/my-account/profile-view.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/modules/settings/my-account/profile-view.tsx b/apps/web/modules/settings/my-account/profile-view.tsx index a85c1b1b7c..b59a64b2cb 100644 --- a/apps/web/modules/settings/my-account/profile-view.tsx +++ b/apps/web/modules/settings/my-account/profile-view.tsx @@ -511,12 +511,12 @@ const ProfileForm = ({ .max(FULL_NAME_LENGTH_MAX_LIMIT, { message: t("max_limit_allowed_hint", { limit: FULL_NAME_LENGTH_MAX_LIMIT }), }), - email: emailSchema, + email: emailSchema.toLowerCase(), bio: z.string(), secondaryEmails: z.array( z.object({ id: z.number(), - email: emailSchema, + email: emailSchema.toLowerCase(), emailVerified: z.union([z.string(), z.null()]).optional(), emailPrimary: z.boolean().optional(), })