Skip to content

Conversation

@vasyl-ks
Copy link
Contributor

Summary

Transport refactor for clearer TCP connection handling and safer error notifications, updated transport tests for stability, and a logger start callback that informs the frontend.

Implementation

  • Transport refactor (backend/transport): split handleTCPConn into focused helpers (configure TCP options, map remote IP to target, guard against duplicate connections, register/unregister, read loop). Guard errChan and TFTP error sends to avoid nil/duplicate notifications.
  • Transport tests (backend/transport/tests): switch to zerolog.Nop() to prevent goroutine panics from test loggers, wire encoder/decoder for packet id 100, add invalid-input/removal coverage, and wait on connection updates before asserting.
  • Logger callback (backend/logger): add an on-start hook to the logger and notify the frontend when logging begins.

- Extract TCP configuration into configureTCPConn
- Extract IP-to-target lookup into resolveTarget
- Extract single-connection check into checkIfActiveConnection
- Extract connection registration into addConnection
- Extract receive loop into tcpReceiveLoop
- use zerolog.Nop() in createTestTransport
- avoid panic when background goroutines log after tests
@Humanoidear Humanoidear merged commit 3d3fe29 into develop Nov 26, 2025
3 checks passed
@Humanoidear Humanoidear deleted the backend/transport branch November 26, 2025 16:45
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.

3 participants