Skip to content

fix(proposals): confirm before accepting a talk proposal - #308

Merged
harshtandiya merged 1 commit into
developfrom
fix/talk-proposal-accept-confirm
Jul 29, 2026
Merged

fix(proposals): confirm before accepting a talk proposal#308
harshtandiya merged 1 commit into
developfrom
fix/talk-proposal-accept-confirm

Conversation

@harshtandiya

Copy link
Copy Markdown
Collaborator

Accept and Create Talk sat in the primary button bar and fired on a single click. It is not a cheap action: it creates an Event Talk and, for every speaker without an account, a User and a Speaker Profile. One stray click made records that are annoying to unwind. Now it lives under Actions behind a confirmation.

While testing the confirm, an empty "Message" dialog showed up after clicking Yes. Two things were going on:

  1. Creating a speaker User makes Frappe emit server messages ("Welcome email sent", "No Roles Specified").
  2. The old handler did frm.save() without awaiting it, then frm.refresh(), then set_route. Two responses ended up in flight together. The second one calls frappe.hide_msgprint() while the first dialog is still fading, and hidden.bs.modal fires late — after the new message has been appended — so onhide empties the body of an already-visible dialog. Blank box, title "Message", blue dot.

So the status change moved into create_talk server-side and the handler is now just call → toast → route. No overlapping requests, no race. It also makes the two writes atomic: before, a failed frm.save() left the talk created but the proposal un-accepted, and the retry hit Talk already created for this proposal! with no way out.

Speaker Users are now created as Website Users, matching get_or_create_guest_user in the booking flow — they sign in to the dashboard, not the desk. This also stops the "No Roles Specified" msgprint, which only fires for System Users. The welcome email is unchanged and still sent.

Not changed: the frappe.hide_msgprint / hidden.bs.modal race is a Frappe core bug. Worth an upstream issue, not patched here.

Tests: 3 new ones covering the status flip, the Website User type, and that a second create_talk raises without leaving a second Event Talk behind. 10 pass in the module.

🤖 Generated with Claude Code

"Accept and Create Talk" fired on a single click and did real work:
it creates an Event Talk and, for every speaker without an account,
a User and a Speaker Profile. Move it into the Actions dropdown and
put a confirmation in front of it.
The status change moves server-side into create_talk. It used to
happen in the browser as an un-awaited frm.save() followed straight
away by frm.refresh() and a route change, which left two responses
racing: the second one hit frappe.hide_msgprint() while the first
dialog was still fading out, and the late hidden.bs.modal handler
emptied the dialog body after the new message had been appended.
The visible result was a blank "Message" box. Doing both writes in
one request removes the race, and makes the two writes atomic --
previously a failed save left the talk created but the proposal
still un-accepted, and the retry hit "Talk already created for this
proposal!" with no way forward.
Speaker Users are now created as Website Users. They sign in to the
dashboard, not the desk, same as the booking flow.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@greptile-appsgreptile-appsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@harshtandiyaharshtandiya added the backport main backport to main branch label Jul 29, 2026
@harshtandiya
harshtandiya merged commit 063e518 into developJul 29, 2026
8 checks passed
@harshtandiya
harshtandiya deleted the fix/talk-proposal-accept-confirm branch July 29, 2026 19:26
@github-actions

Copy link
Copy Markdown
Contributor

Successfully created backport PR for main:

Emmafidelis pushed a commit to Emmafidelis/buzz that referenced this pull request Aug 2, 2026
fix(proposals): confirm before accepting a talk proposal (bwhtech#308)
"Accept and Create Talk" fired on a single click and did real work:
it creates an Event Talk and, for every speaker without an account,
a User and a Speaker Profile. Move it into the Actions dropdown and
put a confirmation in front of it.
The status change moves server-side into create_talk. It used to
happen in the browser as an un-awaited frm.save() followed straight
away by frm.refresh() and a route change, which left two responses
racing: the second one hit frappe.hide_msgprint() while the first
dialog was still fading out, and the late hidden.bs.modal handler
emptied the dialog body after the new message had been appended.
The visible result was a blank "Message" box. Doing both writes in
one request removes the race, and makes the two writes atomic --
previously a failed save left the talk created but the proposal
still un-accepted, and the retry hit "Talk already created for this
proposal!" with no way forward.
Speaker Users are now created as Website Users. They sign in to the
dashboard, not the desk, same as the booking flow.
(cherry picked from commit 063e518)
Co-authored-by: Harsh Tandiya <harsh.tandiya@gmail.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport mainbackport to main branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@harshtandiya