Skip to content

bug: omit empty password from settings update payload - #56

Open
devin-ai-integration[bot] wants to merge 1 commit into
devin/1785137077-angular-upgrade-basefrom
devin/1785138564-fix-settings-empty-password
Open

devin-ai-integration[bot] wants to merge 1 commit into
devin/1785137077-angular-upgrade-basefrom
devin/1785138564-fix-settings-empty-password

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

Summary

Root cause of the 6 settings.spec.ts e2e failures (pre-existing on main, and the only thing keeping the Playwright gate red on #55).

submitForm() posted the whole form, so a user who edited only their bio sent password: "":

-this.userService.update(this.settingsForm.value)   // { username, email, bio, image, password: "" }
+const { password, ...profile } = this.settingsForm.value;
+this.userService.update(password ? { ...profile, password } : profile);

The backend rejects that outright — confirmed directly against the live API:

PUT /api/user  {"user":{...,"password":""}}  -> 422 {"errors":{"body":["password must be a string between 8 and 128 chars"]}}
PUT /api/user  {"user":{...}}                -> 200

So no profile update could succeed unless the user also typed a new password. The e2e tests were correct; the app was wrong.

Targets the integration branch of #55 rather than main so the full gate can go green there.

Verification

bunx playwright test e2e/settings.spec.ts → 7 passed (was 6 failed / 1 passed). bun run build, bun run test -- --run (180 passed), bun run lint, bun run format:check all clean.

Note password still carries Validators.required, which is now clearly wrong for an optional "New Password" field — left alone here to keep the diff to the actual bug, since nothing gates submission on form validity.

Link to Devin session: https://app.devin.ai/sessions/ea13f45ea5f64f718784d770acf9bddb
Requested by: @gaelkekatos-jpg


Devin Review

Status Commit
⚪ Not started —

Run Devin Review

Open in Devin Review (Staging)

The settings form always sent password: '' when the user only changed
their bio or image, and the API rejects that with 422 ("password must be
a string between 8 and 128 chars"), so no profile update could succeed
without also setting a new password.

Co-Authored-By: Gael Kekatos <gael.kekatos@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants