feat: US-009 - Add state save atomicity with SetLastChannel
- Create pkg/state package with State and Manager structs - Implement SetLastChannel with atomic save using temp file + rename - Implement SetLastChatID with same atomic save pattern - Add GetLastChannel, GetLastChatID, and GetTimestamp getters - Use sync.RWMutex for thread-safe concurrent access - Add comprehensive tests for atomic save, concurrent access, and persistence - Cleanup temp file if rename fails Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -137,7 +137,7 @@
|
||||
"go test ./pkg/state -run TestAtomicSave passes"
|
||||
],
|
||||
"priority": 9,
|
||||
"passes": false,
|
||||
"passes": true,
|
||||
"notes": ""
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user