Skip to content

fix: handle atomic saves and improve live-reload reliability#54

Merged
k1LoW merged 1 commit intomainfrom
fix-live-reload
Mar 3, 2026
Merged

fix: handle atomic saves and improve live-reload reliability#54
k1LoW merged 1 commit intomainfrom
fix-live-reload

Conversation

@k1LoW
Copy link
Copy Markdown
Owner

@k1LoW k1LoW commented Mar 3, 2026

Summary

  • Watch for Create/Remove/Rename fsnotify events in addition to Write to support editors using atomic save (write-to-temp + rename pattern used by Vim, VS Code, etc.)
  • Re-add file watcher after rename/remove to maintain watch on new inode; remove files from list when actually deleted
  • Add exponential backoff (1s–30s cap) to SSE reconnection in useSSE.ts
  • Increase SSE subscriber channel buffer from 4 to 16 and log warnings for dropped events and watcher errors

- Watch for Create/Remove/Rename events in addition to Write to support
  editors using atomic save (write-to-temp + rename)
- Re-add file watcher after rename/remove to maintain watch on new inode
- Remove files from list when actually deleted (not just atomic-saved)
- Add exponential backoff to SSE reconnection (1s to 30s cap)
- Increase SSE subscriber channel buffer from 4 to 16
- Log warnings for watcher errors and dropped SSE events
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 3, 2026

Code Metrics Report

main (8480f78) #54 (378509f) +/-
Coverage 39.7% 39.3% -0.4%
Code to Test Ratio 1:0.4 1:0.4 -0.1
Test Execution Time 32s 33s +1s
Details
  |                     | main (8480f78) | #54 (378509f) |  +/-  |
  |---------------------|----------------|---------------|-------|
- | Coverage            |          39.7% |         39.3% | -0.4% |
  |   Files             |             27 |            27 |     0 |
  |   Lines             |           2653 |          2678 |   +25 |
  |   Covered           |           1054 |          1054 |     0 |
- | Code to Test Ratio  |          1:0.4 |         1:0.4 |  -0.1 |
  |   Code              |           3072 |          3100 |   +28 |
  |   Test              |           1460 |          1460 |     0 |
- | Test Execution Time |            32s |           33s |   +1s |

Code coverage of files in pull request scope (26.0% → 24.9%)

Files Coverage +/- Status
internal/frontend/src/hooks/useSSE.ts 0.0% 0.0% modified
internal/server/server.go 26.7% -1.0% modified

Reported by octocov

@k1LoW k1LoW added the enhancement New feature or request label Mar 3, 2026
@k1LoW k1LoW self-assigned this Mar 3, 2026
@k1LoW k1LoW merged commit 24335da into main Mar 3, 2026
3 checks passed
@k1LoW k1LoW deleted the fix-live-reload branch March 3, 2026 04:47
@github-actions github-actions Bot mentioned this pull request Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant