Commit Graph
6 Commits
Author SHA1 Message Date
Cyrille BéraudandCopilot 70a5f4d7ef tests: cover values dropped by a push of a stale session
A push carrying the session of a previous client is dropped, and the
value it announces with it (typically the connection request of an
incoming call). The resubscription it triggers must ask the proxy for
the values it stores, otherwise that value is lost.

Co-authored-by: Copilot (Claude Opus 5.5) <223556219+Copilot@users.noreply.github.com>
2026-09-26 14:29:23 -04:00
Cyrille BéraudandCopilot d14759eadf tests: cover values missed by a failed push subscription
A push subscription that fails (typically while the device has no
network) is retried by restartListeners() on the next connectivity
change. The values stored on the key meanwhile were never received, so
the retry must ask the proxy for them, i.e. not be sent as a refresh.

Co-authored-by: Copilot (Claude Opus 5.5) <223556219+Copilot@users.noreply.github.com>
2026-09-26 13:06:45 -04:00
Adrien Béraud 74a894229f value_cache, op_cache: fix value accounting after edition and re-delivery
OpValueCache counted every re-delivery of an identical value as a new
source, but the proxy client is a single logical source that re-sends
values on push refresh or listen restart: the refcount grew unbounded
and expirations were never propagated. Add a countSources flag to
OpValueCache, OpCache and SearchCache; the proxy client disables it.

When a value is edited (same id, higher seq), only the reporting source
is known to hold the new version: replace it in place, reset the
refcount to 1 and emit a single add. Ignore older versions from lagging
sources on add, and ignore their expiration so they cannot release a
newer version still held by others.

ValueCache emits an edited value as an add instead of silently
refreshing its old copy, and applies a grace period of one type
expiration while the listen is synced so that a single lost refresh
notification does not drop a value the remote node still holds.

SearchCache::get only answers from the cache once the listen is synced,
so a get never returns a partial view that the network would complete.

Add the single-source OpCacheTester cases enabled by countSources.
2026-09-04 15:18:13 -04:00
Adrien Béraud 55af602026 tests: fix build with GCC 14 2026-03-13 15:32:45 -04:00
Adrien Béraud 42971d9587 tests: add test for proxy client token change 2026-03-13 15:10:12 -04:00
Adrien Béraud 4a43326de1 tests: add more proxy tests 2026-03-13 13:06:36 -04:00