Skip to content

fix(device): update assignment cache in autoAssignControllers and unassignAll#15

Merged
hikaps merged 1 commit intodevelopfrom
fix/auto-assign
Apr 22, 2026
Merged

fix(device): update assignment cache in autoAssignControllers and unassignAll#15
hikaps merged 1 commit intodevelopfrom
fix/auto-assign

Conversation

@hikaps
Copy link
Copy Markdown
Owner

@hikaps hikaps commented Apr 22, 2026

Summary

  • Fix m_assignmentCache not being updated in autoAssignControllers() and unassignAll(), causing auto-assigned controllers to lose their assignment on hotplug/reconnect during active sessions

Details

Both methods directly mutated m_devices but skipped updating m_assignmentCache, unlike assignDevice() which correctly maintains it.

autoAssignControllers() — two issues:

  1. Initial unassign step cleared controller assignments from m_devices but left stale entries in the cache
  2. Assign loop wrote assignments to m_devices but never wrote to the cache

unassignAll() — cleared all device assignments but never cleared the cache, so disconnected devices would incorrectly appear as "pending" for reconnection restoration.

The fix mirrors the existing assignDevice() pattern: remove cache entries on unassign, write qMakePair(instanceIndex, name) on assign.

Testing

  • Build passes (100%)
  • All 30 DeviceManager tests pass

…ssignAll

m_assignmentCache was not updated when auto-assigning controllers or
clearing all assignments, causing auto-assigned controllers to lose
their assignment on hotplug/reconnect during active sessions.
@hikaps hikaps merged commit dc3adc8 into develop Apr 22, 2026
1 check passed
@hikaps hikaps deleted the fix/auto-assign branch April 22, 2026 18:16
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.

1 participant