Repository navigation
fix(desktop,mobile): never display a device name the wire mangled - #1589
Merged
Merged
Conversation
The standby line in a phone conversation read, verbatim:
已被 FutureOS Desktop (␦␦␦␦␦␦ļ␦) 接管,现在发不出去。
That is a Chinese computer name a launcher had decoded with a local code
page, arriving as one U+FFFD per lost byte. 87b60f7 fixed where the name
is *produced* (ask the OS, not the environment copy) and where it *enters*
the relay (`declared_name` drops it), but the rule never reached a screen:
every client that renders a peer's name printed whatever it was handed, so a
desktop still running a build that sends the leftovers puts replacement boxes
on the one notice that explains why nothing sends.
Both clients now apply the same rule the host and the relay already do, at
their own rendering junctions:
- Mobile: `readableDeviceName` in `remote/deviceName.ts`, used by the
composer's standby notice, the connection popover, the standby page, the
settings page, the paired-machines list, and the two toast paths that name
the holder when a send is refused. A machine's stored pairing name goes
through it too, falling back to the machine id — the phone keeps that
string forever, so a name learned before the fix would otherwise stay on
the list for good.
- Desktop: `peerHolderName`, which already turned "no name" into null, now
also refuses names carrying replacements or control characters.
A name in Chinese is still a name; the test is replacements, not non-ASCII.
Each new assertion was checked to fail when its guard is reverted.
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.
What
Both clients now refuse to show a device name the wire mangled. A phone's standby notice read, verbatim:
That is a Chinese computer name that a launcher had decoded with a local code page, arriving as one U+FFFD per lost byte, printed on the one notice that explains why nothing sends.
87b60f7c5fixed where such a name is produced and where it enters the relay, but the rule never reached a screen: every client printed whatever it was handed. This applies the host's rule (usable_name/declared_name) at the client rendering junctions.readableDeviceNameinremote/deviceName.ts, used by the composer's standby notice, the connection popover, the standby page, the settings page, the paired-machines list, and the two toasts that name the holder when a send is refused. A stored pairing name goes through it too, falling back to the machine id, so a name learned before the fix does not stay on the list forever.peerHolderNamealready turned "no name" into null; it now also refuses names carrying replacements or control characters.A name in Chinese is still a name — the test is replacements, not non-ASCII.
Commits
fix(desktop,mobile): never display a device name the wire mangledVerification
Local, on the branch tip
aafc7953d(worktree with the main checkout'snode_moduleslinked in):tsc --noEmit(desktop) → clean;eslinton the two touched desktop files → clean;vitest run src/features/remote-peer/peerStatus.test.ts→ 19 passedtsc --noEmit(mobile, Node 22) → clean;eslinton the 15 touched mobile files → clean;jest --runInBandondeviceName.test.ts,desktopStatus.test.ts,StandbyNotice.test.ts→ 3 suites, 30 tests passedEach new assertion was checked to fail with its guard reverted.
User-visible changes
aafc7953d.Notes
none