Repository navigation
fix: prevent recursive IList.Add in ObservableVector - #25314
MartinZikmund merged 1 commit into
Conversation
morning4coffe-dev
left a comment
There was a problem hiding this comment.
Verified by code review at head 68a849a: the explicit IList.Add(object) path, the public Add(T) it now calls, the event count, the new tests, and the linked issue #25215.
APPROVE
Findings:
- (Correct root-cause fix, no finding.) The old
((IList)this).Add(typedValue)re-enteredIList.Add(object)forever, which is the stack overflow in #25215. The new code calls the typedAdd(T)directly (src/Uno.Foundation/Collections/Internal/ObservableVector.cs:105), so the event is raised once, from the same place asIObservableVector.Add(object), and the returned index is_list.Count - 1(line 106). Subclass overrides of the virtualAdd(T)are now honored on the non-generic path too, which matches the typed path. - (Test coverage, adequate.)
When_Item_Added_Through_IListchecks the returned index, count, value, single event, event type, and event index. Before the fix it crashes the test host with a stack overflow, so it fails before and passes after by inspection.When_Incompatible_Item_Added_Through_IListis a guard test that already passed before; it is fine as a regression guard. - (Nit, non-blocking.) None.
Not validated: I did not build or run the tests. The author reports 5/5 focused tests passing. The PR's CI shows only triage, docs, Codacy, WIP and summary checks; no build or unit-test job ran for this PR.
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
🎉 Congratulations on getting your very first pull request merged into Uno Platform! This is a huge milestone — you are now officially part of the community of contributors helping shape the future of cross-platform .NET development, and your code will reach developers and apps all over the world. 🌍 |

GitHub Issue: closes #25215
PR Type:
🐞 Bugfix
What changed? 🚀
Route non-generic IList.Add through the typed collection path without recursively calling itself.
Testing
PR Checklist ✅