Open sharat87 opened 6 days ago
The pull request introduces several changes primarily focused on enhancing configuration parsing and error handling across various files. Key modifications include updating the handling of the APPSMITH_VERSION_ID
to provide a default value, adding a new function to include version information in request headers, and introducing error handling for 400 Bad Request responses. Additionally, the management of version updates has been simplified by removing state tracking, and new error codes have been added to improve error reporting.
File | Change Summary |
---|---|
app/client/public/index.html | Updated APPSMITH_VERSION_ID handling to default to "UNKNOWN" if not set. |
app/client/src/api/interceptors/request/apiRequestInterceptor.ts | Added addVersionHeader function to include X-Appsmith-Version in request headers. |
app/client/src/api/interceptors/response/apiFailureResponseInterceptor.ts | Introduced handleBadRequestError for specific handling of 400 Bad Request errors. |
app/client/src/api/interceptors/response/failureHandlers/handleBadRequestError.ts | New file for handleBadRequestError function to process 400 errors and handle version mismatches. |
app/client/src/api/interceptors/response/failureHandlers/index.ts | Exported handleBadRequestError from the index file for error handling functions. |
app/client/src/sagas/WebsocketSagas/handleAppLevelSocketEvents.tsx | Removed handling for APP_LEVEL_SOCKET_EVENTS.RELEASE_VERSION_NOTIFICATION , simplifying control flow. |
app/client/src/sagas/WebsocketSagas/versionUpdatePrompt.ts | Removed version state management; simplified version update handling and logging. |
app/client/src/utils/storage.ts | Removed functions related to version update state management from local storage. |
app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/SecurityConfig.java | Enhanced error handling by adding version checks against request headers and modifying error response logic. |
app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/AppsmithErrorCode.java | Added new error code VERSION_MISMATCH for version mismatch scenarios. |
APPSMITH_VERSION_ID
and configuration parsing updates in SecurityConfig.java
.package.json
and instrumentation.ts
.mailer.ts
.Bug
π In code we trust, with changes so bright,
Handling versions, we set things right.
From headers to errors, weβve made it clear,
Appsmithβs now stronger, letβs all give a cheer!
π
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
/build-deploy-preview skip-tests=true
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/11932349930.
Workflow: On demand build Docker image and deploy preview
.
skip-tests: true
.
env: ``.
PR: 37551.
recreate: .
Deploy-Preview-URL: https://ce-37551.dp.appsmith.com
@sharat87 : Server side changes LGTM. Can proceed with approval post client side review.
We're adding
x-appsmith-version
to every request from the client. If server sees a request with ax-appsmith-version
that doesn't match its own, it rejects. If the server sees a request without anyx-appsmith-version
header, we don't reject it... for now.On the client, when server responds with the "version mismatch" error, we trigger the "There's a new version, please refresh" toast UI flow.
This is a step towards removing our dependency on websockets and client—RTS connection.
Automation
/test sanity
:mag: Cypress test results
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
Release Notes
New Features
Improvements
Bug Fixes
Chores