Skip to content

Add IObservableMap implementation to windows-collections#4325

Open
Copilot wants to merge 6 commits intomasterfrom
copilot/add-iobservablemap-implementation
Open

Add IObservableMap implementation to windows-collections#4325
Copilot wants to merge 6 commits intomasterfrom
copilot/add-iobservablemap-implementation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 29, 2026

  • Fix unused import in generic_guids.rs
  • Replace custom handler storage in StockObservableMap with Event<MapChangedEventHandler<K,V>> from windows-core
  • Replace custom handler storage in StockObservableVector with Event<VectorChangedEventHandler<T>> from windows-core
  • Fix StockMapChangedEventArgs::Key() to return Err(Error::from(E_BOUNDS)) for Reset events (not Error::empty() which has HRESULT 0 = S_OK, causing COM to return Ok(0) and breaking the map_changed_event test assertion)
  • Merge fire_changed + fire_changed_reset into a single method taking Option<K::Default>

Copilot AI and others added 2 commits April 29, 2026 01:59
…ollections.txt; run cargo fmt

Agent-Logs-Url: https://github.com/microsoft/windows-rs/sessions/c5baf3d4-1e24-4080-9691-8082f9f158ff

Co-authored-by: kennykerr <9845234+kennykerr@users.noreply.github.com>
Copilot AI requested a review from kennykerr April 29, 2026 02:03
@kennykerr
Copy link
Copy Markdown
Collaborator

@copilot fix tests

…vents where Key() returns error

Agent-Logs-Url: https://github.com/microsoft/windows-rs/sessions/fb5ff192-a810-4bd9-a076-7fc60d9ade6f

Co-authored-by: kennykerr <9845234+kennykerr@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 29, 2026

@copilot fix tests

Fixed in adb3e7c. The map_changed_event test was storing keys as i32 and using args.Key()?, which caused the handler to exit early for Reset events (where Key() returns an error since there's no meaningful key). Changed the event storage to Option<i32> and used args.Key().ok() so the handler always succeeds, recording None as the key for Reset.

…st (types now only in windows_collections)

Agent-Logs-Url: https://github.com/microsoft/windows-rs/sessions/34e526cd-a0a8-49f7-9c76-9503d3d2989d

Co-authored-by: kennykerr <9845234+kennykerr@users.noreply.github.com>
…re Event<T> instead of custom handler storage; fix Key() returning E_BOUNDS for Reset events

Agent-Logs-Url: https://github.com/microsoft/windows-rs/sessions/41da4db4-3dea-444e-b8b7-d5f06f1fae66

Co-authored-by: kennykerr <9845234+kennykerr@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants