Skip to content

Return early from teardown() on a closed link - #100

Merged
attermann merged 1 commit into
attermann:masterfrom
zerokelvin-dev:link-teardown-once
Nov 10, 2026
Merged

attermann merged 1 commit into
attermann:masterfrom
zerokelvin-dev:link-teardown-once

Conversation

@jamiecounsell

Copy link
Copy Markdown
Contributor

Calling teardown() on a link that was already closed ran link_closed() again, so the closed callback fired a second time and the teardown reason was overwritten. This returns early for closed links (like the Python reference).

Testing: running in SolarOS on a ThinkNode M9 (ESP32-S3, ESP-IDF) against Python RNS nodes over LoRa, exchanging LXMF messages. Native tests pass, and the series builds for ttgo-lora32-v21 and wiscore_rak4631.

Calling teardown() on a link that was already closed ran link_closed()
again, so the closed callback fired a second time and the teardown reason
was overwritten. teardown() now returns early for closed links, like the
Python reference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019rUgoKJdB4U8fNS9HybY8S
@attermann

Copy link
Copy Markdown
Owner

Thanks for the fix, @jamiecounsell. Returning early from teardown() on a closed link matches the Python reference and stops the closed callback from firing twice. I'll take a final look before merging.

@attermann
attermann merged commit 2d07d9b into attermann:master Nov 10, 2026
8 checks passed
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