Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: unbind previous binding for the same field #18833

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

mcollovati
Copy link
Collaborator

Description

When a field is bound multiple times, the previous bindings are removed from the Binder internal collection, but they are not unboud, leaving listeners attached to the field.
This change unbounds previous bindings when the field is bound again.

Fixes #18826
Fixes #18702

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/guide/contributing/overview/
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • 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.

Additional for Feature type of change

  • Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.

When a field is bound multiple times, the previous bindings are
removed from the Binder internal collection, but they are not
unboud, leaving listeners attached to the field.
This change unbounds previous bindings when the field is bound
again.

Fixes #18826
Fixes #18702
Copy link

sonarcloud bot commented Feb 29, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

Test Results

1 094 files  ±0  1 094 suites  ±0   1h 19m 39s ⏱️ + 2m 14s
6 935 tests +1  6 887 ✅ +1  48 💤 ±0  0 ❌ ±0 
7 279 runs   - 1  7 219 ✅  - 1  60 💤 ±0  0 ❌ ±0 

Results for commit 56a9628. ± Comparison against base commit a68c8b0.

@tepi tepi merged commit 75297ef into main Feb 29, 2024
26 checks passed
@tepi tepi deleted the issues/18826_bind_field_twice branch February 29, 2024 11:29
vaadin-bot pushed a commit that referenced this pull request Feb 29, 2024
When a field is bound multiple times, the previous bindings are
removed from the Binder internal collection, but they are not
unboud, leaving listeners attached to the field.
This change unbounds previous bindings when the field is bound
again.

Fixes #18826
Fixes #18702
@vaadin-bot
Copy link
Collaborator

Hi @mcollovati and @tepi, when i performed cherry-pick to this commit to 24.2, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick 75297ef
error: could not apply 75297ef... fix: unbind previous binding for the same field (#18833)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

mcollovati added a commit that referenced this pull request Feb 29, 2024
When a field is bound multiple times, the previous bindings are
removed from the Binder internal collection, but they are not
unboud, leaving listeners attached to the field.
This change unbounds previous bindings when the field is bound
again.

Fixes #18826
Fixes #18702
vaadin-bot added a commit that referenced this pull request Feb 29, 2024
When a field is bound multiple times, the previous bindings are
removed from the Binder internal collection, but they are not
unboud, leaving listeners attached to the field.
This change unbounds previous bindings when the field is bound
again.

Fixes #18826
Fixes #18702

Co-authored-by: Marco Collovati <marco@vaadin.com>
tepi pushed a commit that referenced this pull request Mar 1, 2024
When a field is bound multiple times, the previous bindings are
removed from the Binder internal collection, but they are not
unboud, leaving listeners attached to the field.
This change unbounds previous bindings when the field is bound
again.

Fixes #18826
Fixes #18702
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Binder exception after 24.3.3 to 24.3.5 upgrade Binder throws NPE when field was bound twice
3 participants