Tags: ZaparooProject/go-pn532
Tags
Increase timeout durations and improve concurrency handling in tests - Extended context timeout in `main_test.go` for longer-running tests. - Integrated acknowledgment timeout handling in session pause logic. - Refactored tests to use atomic counters, ensuring thread-safe assertions. - Added timeouts to prevent infinite loops in session state checks. Enhancements improve test reliability and robustness in multi-threaded scenarios.
Add context-aware operation support and improved session management - Enhanced `WriteToTag` and `WriteToNextTag` with explicit context controls (sessionCtx, writeCtx) for better cancellation and timeout handling. - Simplified error handling in `runWriteMode` to highlight areas for improvement. - Introduced acknowledgment channel (`ackChan`) to synchronize polling pauses with proper signaling. - Improved thread safety in `pauseWithAck` and `handlePauseSignal` to prevent race conditions. - Updated tests to cover new context-aware methods, including cancellation, acknowledgment, and concurrency scenarios. - Added `safeTimerStop` utility to prevent race conditions with active timers. These changes enhance session lifecycle management, robustness in concurrent environments, and provide clearer error handling pathways for NFC operations.
PreviousNext