Skip to content

fix: avoid stale event reference in register page retry action#976

Merged
MODSetter merged 1 commit intoMODSetter:devfrom
LikiosSedo:fix/stale-event-register-retry
Mar 25, 2026
Merged

fix: avoid stale event reference in register page retry action#976
MODSetter merged 1 commit intoMODSetter:devfrom
LikiosSedo:fix/stale-event-register-retry

Conversation

@LikiosSedo
Copy link
Contributor

@LikiosSedo LikiosSedo commented Mar 25, 2026

Summary

  • Extract submitForm() from handleSubmit so the retry toast action calls the current function reference instead of capturing a stale event object

Test plan

  • Verify registration form submit still works
  • Verify retry button in error toast triggers a fresh submission

High-level PR Summary

This PR fixes a bug where the retry button on the registration error toast was capturing a stale event reference. The fix extracts the form submission logic into a separate submitForm() function that can be called both from the event handler and from the retry action, ensuring fresh submissions without relying on captured event objects.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_web/app/(home)/register/page.tsx

Need help? Join our Discord

Analyze latest changes

Extract submission logic into submitForm() so the retry toast
action does not capture the original SyntheticEvent, which may
be recycled by React by the time the user clicks retry.

Closes MODSetter#945
@vercel
Copy link

vercel bot commented Mar 25, 2026

@LikiosSedo is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@recurseml recurseml bot left a comment

Choose a reason for hiding this comment

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

Review by RecurseML

🔍 Review performed on a474c46..e9c51a9

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (1)

surfsense_web/app/(home)/register/page.tsx

@MODSetter MODSetter merged commit 0a5873c into MODSetter:dev Mar 25, 2026
7 of 10 checks passed
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.

2 participants