[Bug]: Serial connection not closed when disconnecting in the Web Client
Maintainers usually reply within 1 day
Nobody has claimed this yet.
- #1480 by @ayushdwivedi-stack — closed without merging
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 58/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- react, typescript
- Domain
- frontend
Research direction
Start at the serial disconnect flow and the fromDevice.cancel() call; the issue provides no file or test path, so first locate the disconnect handler and its stream cleanup logic. Reproduce using the listed serial-device steps, then verify disconnect releases the connection and reconnect no longer hangs without a page refresh.
Written by the indexing model from the issue text.
Description
Before submitting
- I have searched existing issues to make sure this bug hasn't already been reported
- I have updated to the latest version of the software to verify the issue still exists
- I have cleared cache/cookies/storage or tried in a private/incognito window (if applicable)
Hardware
Seeed Studio T1000-e
Connection Type
Serial
Local or Hosted
Firmware Version
2.7.26.54e08d8
Operating System
Windows 11
Browser
Chrome 153.0.8010.48 (Official Build) (64-bit)
Expected Behavior
When the Disconnect button is used, the underlying serial connection should be closed, so that it is free for other processes to use.
Actual Behavior
When the Disconnect button is used, the fromDevice.cancel() throws an error:
Failed to execute 'cancel' on 'ReadableStream': Cannot cancel a locked stream.
The underlying connection stays open, and packets continue to be received.
As the web client page believes the connection to be closed, trying to connect again results in it appearing to hang (See #960)
The only way to release the connection is to refresh the page or close the browser tab.
Steps to Reproduce
- Connect to Meshtastic device on Serial
- Wait for the connection to succeed
- Return to the devices page
- Click the Disconnect button
- Try to Connect , watch it hang
Relevant console output
16:03:10:421 DEBUG [iMeshDevice] Disconnect 🔌 Disconnecting from device
Error closing serial port: TypeError: Failed to execute 'close' on 'SerialPort': Cannot cancel a locked stream
Could not cleanly disconnect serial port: TypeError: Failed to execute 'close' on 'SerialPort': Cannot cancel a locked stream
16:03:10:428 INFO [iMeshDevice] ConnectionStatus 🔗 DeviceDisconnected (user)
index-DoHPLyNc.js:185 Error closing port before reconnect: TypeError: Failed to execute 'close' on 'SerialPort': Cannot cancel a locked stream
[useConnections] Starting configuration
16:03:15:178 DEBUG [iMeshDevice] Configure ⚙️ Requesting device configuration
ncaught (in promise) TypeError: Failed to execute 'pipeThrough' on 'ReadableStream': Cannot pipe a locked stream
Screenshots
Additional Context
The console output is actually taken from the newer https://client-test.meshtastic.org/
- Dominant language
- TypeScript
- Stars
- 861
- Forks
- 316
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 18
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from meshtastic/web
-
i18n
Difficulty 1/5 Under an hour Newbie friendliness 82/100
meshtastic/web#1187 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 25/100
meshtastic/web#1532 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 52/100
meshtastic/web#1504 ·
Maintainers usually reply within 1 day
-
[Bug]: Serial connection to nRF52 device (T1000-E) never loads; port opened without DTR assertedOpen
Difficulty 3/5 Half a day Newbie friendliness 45/100
meshtastic/web#1499 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 58/100
meshtastic/web#1498 ·
Maintainers usually reply within 1 day
Similar issues
-
P3
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug L3 level 1 needs-review wocs
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
SatyamPandey-07/WorkSphere#10739 · 1 comment ·
Maintainers usually reply within 1 day
-
maintenance
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
assistant-ui/assistant-ui#10946 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:auth-provider issue-rating: 🦞 diamond lobster no-stale P2
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
openclaw/openclaw#206303 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day