Skip to content

[OP-19885] User cannot update own profile because password confirmation autosaves - #24727

Open
oliverguenther wants to merge 2 commits into
release/17.8from
bug/op-19885-user-cannot-update-own-profile-because-password-confirmation-autosaves
Open

[OP-19885] User cannot update own profile because password confirmation autosaves#24727
oliverguenther wants to merge 2 commits into
release/17.8from
bug/op-19885-user-cannot-update-own-profile-because-password-confirmation-autosaves

Conversation

@oliverguenther

Copy link
Copy Markdown
Member

Capture the submit event so we can stop other submit handlers (such as the CKEditor component) from firing and submitting the form again in absence of the confirmation

https://community.openproject.org/work_packages/OP-19885

@oliverguenther
oliverguenther force-pushed the bug/op-19885-user-cannot-update-own-profile-because-password-confirmation-autosaves branch from 02169cf to ed5ed06 Compare August 13, 2026 06:29

@bsatarnejad bsatarnejad 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.

Codewise, It looks good 👍🏼
But it does not fix the. issue that after cancelling the confirmation, the form can be re-submitted, I press the update button, but nothing happens.

// (notably CKEditor-augmented textareas), which can otherwise re-submit via
// Turbo and bypass the confirmation dialog.
this.element.addEventListener('submit', this.formListener, { capture: true });
document.addEventListener('password-confirmation-dialog:close', this.dialogCloseListener);

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.

After cancelling, clicking Update profile again does nothing because this close event is not fired and activeDialog stays true.

@oliverguenther

Copy link
Copy Markdown
Member Author

@bsatarnejad I fixed that second regression

After cancel, Primer/Turbo removes the dialog during its native close handler,
which disconnects the dialog Stimulus controller before it can emit password-confirmation-dialog:close.
This caused activeDialog to stay true and further submits were ignored.
@oliverguenther
oliverguenther force-pushed the bug/op-19885-user-cannot-update-own-profile-because-password-confirmation-autosaves branch from 5ba4399 to 7f0ed1c Compare August 18, 2026 12:01
@oliverguenther
oliverguenther changed the base branch from release/17.7 to release/17.8 August 18, 2026 12:01
@github-actions

Copy link
Copy Markdown

Warning

Flaky specs

  • rspec ./spec/features/projects/creation_wizard/project_creation_wizard_spec.rb[1:4]
  • rspec ./spec/features/projects/creation_wizard/wizard_from_template_flow_spec.rb[1:1]
🤖 Ask Copilot to investigate

Copy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer.

@copilot The following spec(s) are flaky in CI (first seen on PR #24727, linked for reference only):

- `rspec ./spec/features/projects/creation_wizard/project_creation_wizard_spec.rb[1:4]`
- `rspec ./spec/features/projects/creation_wizard/wizard_from_template_flow_spec.rb[1:1]`

Treat this as a standalone task, unrelated to PR #24727. Create a new branch from origin/dev and open a new pull request targeting dev — do not stack it on PR #24727 or reuse that branch.

Follow the playbook in docs/development/testing/handling-flaky-tests/README.md to find the root cause and fix the underlying race — do not skip, delete, or weaken the spec to make it pass; disabling is a last resort per the playbook, and only with a bug ticket. Verify the fix by running the spec(s) repeatedly (e.g. `script/bulk_run_rspec --run-count 10`).

If you cannot reproduce the flake or are not confident in a fix after reasonable investigation, do not fabricate a change or skip the spec to force CI green. Instead, leave the pull request in draft and document what you tried, the suspected cause, and any leads in its description, then assign @oliverguenther to take over.

Once the fix is verified, title the PR after the spec(s) it fixes, and use the PR description to explain the root cause, how the change resolves it, and the before/after results. Label the PR `flaky-spec`, assign @oliverguenther, and request a review from @oliverguenther.
On every commit, set @oliverguenther as the sole co-author with a `Co-authored-by:` trailer (use their GitHub no-reply email so it links to their account), so it is traceable who dispatched the fix.

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

Development

Successfully merging this pull request may close these issues.

2 participants