Mouse Without Borders: deduplicate machine entries in device layout#46863
Open
DaveT1991 wants to merge 3 commits intomicrosoft:mainfrom
Open
Mouse Without Borders: deduplicate machine entries in device layout#46863DaveT1991 wants to merge 3 commits intomicrosoft:mainfrom
DaveT1991 wants to merge 3 commits intomicrosoft:mainfrom
Conversation
The schwa (ə) is an IPA phonetic symbol, not an Italian accented letter, and is already covered by the IPA language set. The Euro sign (€) is a currency symbol and does not belong in a language-specific accent set. Italian only uses è and é as accented forms of the letter e. Fixes microsoft#46857
When loading the machine matrix, two scenarios could produce a duplicate machine slot that the user had no way to remove: 1. MachinePool stored the same machine name under multiple IDs (e.g. after a reconnect with a new ID). The available-machine list was built without deduplication, so both entries could end up racing for the same slot. 2. A matrix persisted from an earlier session already contained a duplicate name. The removal loop only checked availability against MachinePool, so the duplicate passed through and was preserved on every reload. Fix both by: - Deduplicating the available-machine list as it is built from MachinePool (case-insensitive, matching the rest of the codebase). - Tracking seen names in a HashSet while iterating the saved matrix and clearing any slot whose name has already appeared earlier. - Making all Contains comparisons case-insensitive for consistency. Fixes microsoft#46858
Collaborator
|
This does not follow the PR template, includes 2 commits unrelated to the issue, and appears AI generated. |
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.
Summary
Two scenarios caused a duplicate machine to appear in the Device Layout
that the user had no way to remove:
MachinePool with multiple IDs for the same name — if a machine
reconnected and was assigned a new ID,
MachinePoolcould hold"PC1:ID1,PC1:ID2". The available-machine list was built withoutdeduplication, opening the door for both entries to fill slots.
Persisted duplicate in the saved matrix — the removal loop only
checked whether each slot's name was still in
MachinePool. It neverchecked for duplicates within the matrix itself, so a duplicate
saved in an earlier session survived every reload with no way to clear it.
Changes (
MouseWithoutBordersViewModel.cs—LoadMachineMatrixString):availableMachinesthrough aHashSetso each name appears atmost once (case-insensitive, matching
MachinePool.NamesAreEqual).HashSetwhile iterating the saved matrix;any slot whose name was already seen is cleared to
string.EmptyandeditedTheMatrixis set so the fix is persisted immediately.Containscalls case-insensitive for consistency.Issues Fixed
Fixes #46858