Repository navigation
Fix external tree binding ignoring changes to ids on Reload - #6574
Merged
Merged
Conversation
BindTree kept only a private copy of the ids map, so nested changes made to the external map were not seen by Reload. Keep the pointer and use the live map when reloading. Fixes fyne-io#6570
The tree shares the caller's ids map, so a nil map created for the binding must be stored through the pointer or later appends are lost. Document the sharing on BindTree.
andydotxyz
requested changes
Oct 6, 2026
andydotxyz
left a comment
Member
There was a problem hiding this comment.
Thanks for looking at this, two things came to mind when reviewing:
- the "extIDs" (could just be
idslikevalis of similar externality) have a lot of nil checks - butvaldoes not. When will the IDs be nil when the values are not? - there are many comments where not needed - particularly you should not document fixed bugs in function documentation.
Hold the ids as a pointer in treeBase, defaulting to a new map as val does, so the bound tree reads and writes the caller's map directly. This drops the separate extIDs field, its nil checks and the comments.
2 tasks done
Contributor
Author
|
|
andydotxyz
approved these changes
Oct 24, 2026
andydotxyz
left a comment
Member
There was a problem hiding this comment.
Excellent, thanks for cleaning this up
Member
|
The static analysis was fixed on develop, so merging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Fixes #6570.
BindTreekept only a private copy of theidsmap, so changes the caller made to the external ids (the nested structure) were never seen byReload, and the tree showed up flat. The tree now keeps the pointer to the caller's map and re-reads it on reload; a nil map is created and written back so later appends are not lost. The sharing is documented onBindTree.Checklist:
go test ./data/binding/)Where applicable: