Skip to content

fix: Password reset page shows blank username#10534

Open
dblythy wants to merge 1 commit into
parse-community:alphafrom
dblythy:fix/password-reset-page-username
Open

fix: Password reset page shows blank username#10534
dblythy wants to merge 1 commit into
parse-community:alphafrom
dblythy:fix/password-reset-page-username

Conversation

@dblythy

@dblythy dblythy commented Jul 4, 2026

Copy link
Copy Markdown
Member

Closes #10245

Summary by CodeRabbit

  • Bug Fixes

    • Improved the password reset page so it only shows the account name when one is available.
    • Removed awkward placeholder text when no account name is provided, making the message cleaner and more accurate.
  • Tests

    • Added coverage for password reset pages to confirm the message displays correctly with and without an account name.

@parse-github-assistant

Copy link
Copy Markdown

🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review.

Tip

  • Keep pull requests small. Large PRs will be rejected. Break complex features into smaller, incremental PRs.
  • Use Test Driven Development. Write failing tests before implementing functionality. Ensure tests pass.
  • Group code into logical blocks. Add a short comment before each block to explain its purpose.
  • We offer conceptual guidance. Coding is up to you. PRs must be merge-ready for human review.
  • Our review focuses on concept, not quality. PRs with code issues will be rejected. Use an AI agent.
  • Human review time is precious. Avoid review ping-pong. Inspect and test your AI-generated code.

Note

Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect.

Caution

Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement. Our CI and AI review are safeguards, not development tools. If many issues are flagged, rethink your development approach. Invest more effort in planning and design rather than using review cycles to fix low-quality code.

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The password reset HTML templates (default, German, and Austrian German locales) were updated to conditionally render the "for your account: {{username}}" portion using a Mustache-style conditional block instead of always displaying it. Corresponding spec tests were added to verify both cases.

Changes

Password Reset Username Conditional

Layer / File(s) Summary
Conditional username rendering and tests
public/password_reset.html, public/de/password_reset.html, public/de-AT/password_reset.html, spec/PagesRouter.spec.js
Templates now use a {{#username}}…{{/username}} block to only append "for your account: {{username}}" when username is present; new tests verify the clause is omitted when username is absent and included when present.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Poem

A bunny hopped through pages three,
Where "undefined" once used to be,
Now username shows only when it's there,
Wrapped snug in Mustache's careful care,
Tests confirm it, clean and neat — hooray!🐰

🚥 Pre-merge checks | ✅ 4 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description only says 'Closes #10245' and omits the required Issue, Approach, and Tasks sections. Add the template sections for Issue, Approach, and Tasks, and briefly describe the change and test status.
Linked Issues check ⚠️ Warning The PR changes the template and tests, but it does not update the redirect URL to supply username as required by #10245. Include username in the password reset redirect URL in PublicAPIRouter.js so the template can render the friendly name.
Engage In Review Feedback ❓ Inconclusive Repo diff shows template/test changes, but no review-thread metadata or discussion history is present to verify engagement with feedback comments. Provide the PR review comments or GitHub thread history so I can confirm whether feedback was discussed and either implemented or retracted.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is specific and uses the required fix: prefix while matching the password reset username issue.
Out of Scope Changes check ✅ Passed The shown template updates and tests are all directly related to the password reset username fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Security Check ✅ Passed Username is still rendered via escaped Mustache tags, and existing XSS tests cover username, token, and locale inputs.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.66%. Comparing base (cce91e5) to head (951283e).
⚠️ Report is 1 commits behind head on alpha.

Additional details and impacted files
@@           Coverage Diff           @@
##            alpha   #10534   +/-   ##
=======================================
  Coverage   92.66%   92.66%           
=======================================
  Files         193      193           
  Lines       16981    16981           
  Branches      248      248           
=======================================
  Hits        15736    15736           
  Misses       1224     1224           
  Partials       21       21           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dblythy

dblythy commented Jul 5, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@dblythy

dblythy commented Jul 5, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@dblythy

dblythy commented Jul 5, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@dblythy

dblythy commented Jul 5, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
spec/PagesRouter.spec.js (1)

312-329: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Use passwordReset() in both tests for symmetry.

The "omits username" test exercises goToPage() directly instead of passwordReset(), unlike the sibling test. Since the actual bug (and this PR's fix) is scoped to passwordReset() building params.username from req.query.username, testing via the real handler in both cases would more faithfully validate the fix and keep the two tests symmetric.

♻️ Suggested alignment
       it('omits the username clause on the password reset page when no username is set', async () => {
-        await expectAsync(router.goToPage(req, pages.passwordReset)).toBeResolved();
+        req.params = { appId: config.appId };
+        await expectAsync(router.passwordReset(req)).toBeResolved();
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@spec/PagesRouter.spec.js` around lines 312 - 329, The password reset spec is
asymmetric: the “omits username” case calls router.goToPage() directly instead
of exercising router.passwordReset() like the sibling test. Update that test to
invoke router.passwordReset(req) so both cases validate the same handler path
that builds params.username from req.query.username, keeping the assertions on
pageResponse and replacedContent aligned.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@spec/PagesRouter.spec.js`:
- Around line 312-329: The password reset spec is asymmetric: the “omits
username” case calls router.goToPage() directly instead of exercising
router.passwordReset() like the sibling test. Update that test to invoke
router.passwordReset(req) so both cases validate the same handler path that
builds params.username from req.query.username, keeping the assertions on
pageResponse and replacedContent aligned.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4cbb3152-97f7-4ca1-a22a-cb4048930547

📥 Commits

Reviewing files that changed from the base of the PR and between 7e9d53a and 951283e.

📒 Files selected for processing (4)
  • public/de-AT/password_reset.html
  • public/de/password_reset.html
  • public/password_reset.html
  • spec/PagesRouter.spec.js

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.

choose_password template shows "undefined" for username — username param missing from reset redirect URL

1 participant