centrifugal / centrifuge

Real-time messaging library for Go. The simplest way to add feature-rich and scalable WebSocket support to your application. The core of Centrifugo server.
https://pkg.go.dev/github.com/centrifugal/centrifuge
MIT License
1.08k stars 92 forks source link

Handle evicted meta key scenario #412

Open FZambia opened 1 day ago

FZambia commented 1 day ago

Relates https://github.com/centrifugal/centrifugo/issues/888

Currently when stream meta key not found (evicted by LRU/LFU strategies), Centrifuge returns an error:

The ID specified in XADD is equal or smaller than the target stream top item

Until stream expires. We handle this scenario here by deleting current stream - clients with recovery/positioning will be unsubscribed with insufficient state reason (because epoch changes).

codecov[bot] commented 1 day ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 81.35%. Comparing base (605848e) to head (06c1f82). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #412 +/- ## ========================================== - Coverage 81.37% 81.35% -0.02% ========================================== Files 40 40 Lines 7204 7204 ========================================== - Hits 5862 5861 -1 - Misses 966 967 +1 Partials 376 376 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.