From c234474b892634e8d82e2a11703403fb5819418d Mon Sep 17 00:00:00 2001 From: Hetu Nandu Date: Thu, 30 Mar 2023 16:59:52 +0530 Subject: [PATCH] Capture sentry error if update page api is called without an id --- app/client/src/sagas/PageSagas.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/client/src/sagas/PageSagas.tsx b/app/client/src/sagas/PageSagas.tsx index 919f865970..bd51326035 100644 --- a/app/client/src/sagas/PageSagas.tsx +++ b/app/client/src/sagas/PageSagas.tsx @@ -659,6 +659,17 @@ export function* createPageSaga( export function* updatePageSaga(action: ReduxAction) { try { const request: UpdatePageRequest = action.payload; + + // Update page *needs* id to be there. We found certain scenarios + // where this was not happening and capturing the error to know gather + // more info: https://github.com/appsmithorg/appsmith/issues/16435 + if (!request.id) { + Sentry.captureException( + new Error("Attempting to update page without page id"), + ); + return; + } + // to be done in backend request.customSlug = request.customSlug?.replaceAll(" ", "-");