From bded8cc1fec6928035a71e850b3cc5ca2d536207 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Mon, 30 Mar 2026 23:14:24 +0200 Subject: [PATCH] Add additional Sentry error capture and refine profile data update logic --- backend/api/package.json | 2 +- backend/api/src/helpers/endpoint.ts | 4 ++++ web/pages/profile.tsx | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/api/package.json b/backend/api/package.json index b8e9a950..f17cc154 100644 --- a/backend/api/package.json +++ b/backend/api/package.json @@ -1,6 +1,6 @@ { "name": "@compass/api", - "version": "1.30.0", + "version": "1.30.1", "private": true, "description": "Backend API endpoints", "main": "src/serve.ts", diff --git a/backend/api/src/helpers/endpoint.ts b/backend/api/src/helpers/endpoint.ts index 8489b2da..a5a498cf 100644 --- a/backend/api/src/helpers/endpoint.ts +++ b/backend/api/src/helpers/endpoint.ts @@ -134,6 +134,10 @@ export const validate = (schema: T, val: unknown) => { if (issues.length > 0) { log.error(issues.map((i) => `${i.field}: ${i.context}`).join('\n')) } + console.error('Validation failed', {issues, schema, val}) + Sentry.captureException(APIErrors.validationFailed(issues), { + extra: {issues, schema, val}, + }) throw APIErrors.validationFailed(issues) } else { return result.data as z.infer diff --git a/web/pages/profile.tsx b/web/pages/profile.tsx index c8cee893..fb300bfd 100644 --- a/web/pages/profile.tsx +++ b/web/pages/profile.tsx @@ -79,7 +79,7 @@ function ProfilePageInner(props: {user: User; profile: Profile}) { debug('parsedProfile', parsedProfile) const promises: Promise[] = filterDefined([ updateProfile(parsedProfile), - baseUser && updateUser(baseUser), + baseUser && updateUser({name: baseUser.name, username: baseUser.username}), interests && api('update-options', {table: 'interests', values: interests}), causes && api('update-options', {table: 'causes', values: causes}), work && api('update-options', {table: 'work', values: work}),