-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Remove unused JSON signup API handler #37387
Conversation
WalkthroughThis pull request introduces significant changes to user management functionalities across several files. Key modifications include the removal of user creation and fetching capabilities in the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Failed server tests
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
app/client/src/pages/UserAuth/helpers.ts (1)
56-60
: Consider consolidating error handling patterns.While the type improvements are good, I notice that error handling differs slightly between
resetPasswordSubmitHandler
andforgotPasswordSubmitHandler
(one sets email to empty string, the other doesn't). Consider standardizing this pattern.}).catch((error) => { - error.email = ""; throw new SubmissionError(error); });
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (8)
app/client/cypress/support/commands.js
(0 hunks)app/client/src/ce/api/UserApi.tsx
(0 hunks)app/client/src/ce/constants/ReduxActionConstants.tsx
(0 hunks)app/client/src/ce/sagas/userSagas.tsx
(0 hunks)app/client/src/ee/sagas/userSagas.tsx
(0 hunks)app/client/src/pages/UserAuth/helpers.ts
(3 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/UserControllerCE.java
(0 hunks)app/server/appsmith-server/src/test/java/com/appsmith/server/configurations/CommonConfigTest.java
(1 hunks)
💤 Files with no reviewable changes (6)
- app/client/cypress/support/commands.js
- app/client/src/ce/api/UserApi.tsx
- app/client/src/ce/constants/ReduxActionConstants.tsx
- app/client/src/ce/sagas/userSagas.tsx
- app/client/src/ee/sagas/userSagas.tsx
- app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/UserControllerCE.java
🔇 Additional comments (3)
app/server/appsmith-server/src/test/java/com/appsmith/server/configurations/CommonConfigTest.java (1)
30-30
: LGTM! Verify related view configurations
The updated assertion aligns with the removal of JSON signup handler. However, let's verify that this change is consistently reflected in related view configurations.
app/client/src/pages/UserAuth/helpers.ts (2)
4-4
: LGTM! Good type safety improvement.
The explicit import of Dispatch
type enhances type safety by replacing any
type.
34-38
: Verify the promise resolution handling in consumers.
The function now explicitly returns Promise<undefined>
instead of Promise<any>
. While this is more type-safe, ensure all consumers handle this correctly.
✅ Verification successful
Let's search more broadly to find any usage of this handler and understand the Promise handling context in the authentication flow.
Type change to Promise<undefined>
is safe and properly handled
The function is only used in ResetPassword.tsx
as a form submit handler, where the Promise resolution value is not used. The pattern is consistent with other auth handlers like forgotPasswordSubmitHandler
which also return Promise<undefined>
.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for any direct usage of resetPasswordSubmitHandler
rg "resetPasswordSubmitHandler\(" -A 3
Length of output: 40
Script:
#!/bin/bash
# Search for resetPasswordSubmitHandler in TypeScript/JavaScript files
rg -t ts -t js "resetPasswordSubmitHandler" -B 2 -A 2
# Search for files containing resetPassword in their name
fd "resetPassword"
# Look for any Promise-related handling in the UserAuth directory
rg "Promise" "app/client/src/pages/UserAuth" -B 2 -A 2
Length of output: 2649
@@ -27,6 +27,6 @@ public void objectMapper_BeanCreated_WithPublicJsonViewAsDefault() throws JsonPr | |||
userData.setUserPermissions(null); | |||
|
|||
String value = objectMapper.writeValueAsString(userData); | |||
JSONAssert.assertEquals("{\"proficiency\":\"abcd\",\"role\":\"new_role\"}", value, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unsure of why the test case got updated as part of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Case of working on the wrong branch. 🙂
This change is already on release
.
This PR removes the JSON-version of signup API handler, and its unused references. We use the other Form-body-version of this API, but not this. So this isn't needed. Fewer things there are, fewer there are to protect. ## Automation /test sanity authentication ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/11838832000> > Commit: f27d2c9 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11838832000&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Sanity, @tag.Authentication` > Spec: > <hr>Thu, 14 Nov 2024 14:49:54 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced new Cypress commands for enhanced API interactions and UI validations. - Added a method for handling user creation through form-encoded data. - **Bug Fixes** - Improved error handling and validation checks in various commands. - **Documentation** - Updated type definitions and submit handler functions for better clarity and maintainability. - **Chores** - Removed unused user management functionalities, streamlining the codebase. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This PR removes the JSON-version of signup API handler, and its unused references. We use the other Form-body-version of this API, but not this. So this isn't needed. Fewer things there are, fewer there are to protect. ## Automation /test sanity authentication ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/11838832000> > Commit: f27d2c9 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11838832000&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Sanity, @tag.Authentication` > Spec: > <hr>Thu, 14 Nov 2024 14:49:54 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced new Cypress commands for enhanced API interactions and UI validations. - Added a method for handling user creation through form-encoded data. - **Bug Fixes** - Improved error handling and validation checks in various commands. - **Documentation** - Updated type definitions and submit handler functions for better clarity and maintainability. - **Chores** - Removed unused user management functionalities, streamlining the codebase. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This PR removes the JSON-version of signup API handler, and its unused references. We use the other Form-body-version of this API, but not this. So this isn't needed.
Fewer things there are, fewer there are to protect.
Automation
/test sanity authentication
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11838832000
Commit: f27d2c9
Cypress dashboard.
Tags:
@tag.Sanity, @tag.Authentication
Spec:
Thu, 14 Nov 2024 14:49:54 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores