• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 23836166353

01 Apr 2026 06:58AM UTC coverage: 65.542% (+0.02%) from 65.527%
23836166353

push

github

web-flow
Add DataStorage interface and implementations (#4458)

* Add DataStorage interface and implementations

Introduce DataStorage, a key-value metadata store separate from the
existing Session-based Storage interface. Unlike Storage, DataStorage
never round-trips live session objects — it stores only serialisable
map[string]string metadata.

This separation avoids the type-assertion bug where a Redis round-trip
deserialises a MultiSession as a plain *StreamableSession, losing all
backend connections and routing state.

Two implementations are provided:
- LocalSessionDataStorage: in-memory sync.Map with TTL-based eviction
  and a background cleanup goroutine.
- RedisSessionDataStorage: Redis/Valkey-backed with sliding-window TTL
  via GETEX on every Load, and atomic SET NX for StoreIfAbsent.

Both pass a shared contract test suite covering Store/Load round-trips,
upsert, nil metadata, empty-ID errors, Exists (without TTL refresh),
StoreIfAbsent atomicity, Delete idempotency, and TTL behaviour.

Related-to: #4420

* changes from review

---------

Co-authored-by: taskbot <taskbot@users.noreply.github.com>

161 of 206 new or added lines in 4 files covered. (78.16%)

18 existing lines in 4 files now uncovered.

53178 of 81136 relevant lines covered (65.54%)

64.71 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.15
/pkg/transport/proxy/httpsse/http_proxy.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc