fix: prevent setting both login listeners and form action
Description
Setting both login listeners and form action can cause unexpected behaviors because of concurrent processing of form submission processing and login event. For example, if form submission ends in a session ID change and a redirect to a different page, the UIDL request may fail with a session expiration response, causing the Flow client to reload the page and potentially cancel the ongoing redirection. In addition, after from submission, the login event would be sent to a dismissed UI. This change prevents setting both action and login listeners throwing an exception.
References vaadin/flow#12640
Type of change
- [x] Bugfix
- [ ] Feature
Checklist
- [x] I have read the contribution guide: https://vaadin.com/docs/latest/contributing/overview
- [x] I have added a description following the guideline.
- [x] The issue is created in the corresponding repository and I have referenced it.
- [x] I have added tests to ensure my change is effective and works as intended.
- [ ] New and existing tests are passing locally with my change.
- [ ] I have performed self-review and corrected misspellings.
- [x] I have not completed some of the steps above and my pull request can be closed immediately.
Additional for Feature type of change
- [ ] Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.
@mcollovati , are there any further actions planned on this one or is it ready for the review?
There is a slightly related PR on Flow, that tries to resolve the issue in a more general way, but it is on hold. However, I think this change could make sense regardless of the potential change in Flow. I'll mark the PR as ready for review.
@mcollovati , we will overtake the PR and try to come up with a way of not introducing breaking changes.
Quality Gate passed
Issues
1 New issue
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
This ticket/PR has been released with Vaadin 24.6.0.alpha2 and is also targeting the upcoming stable 24.6.0 version.