Effects client reconciles pending effects: drop stale wait deadlines and seen keys, emit completion for vanished runs; run_not_active is terminal
CI / check (push) Successful in 25s
CI / publish (push) Has been skipped

This commit is contained in:
edmand46
2026-09-06 09:53:45 +03:00
parent ef5624ee4e
commit 62025592ba
2 changed files with 59 additions and 8 deletions
@@ -27,7 +27,9 @@ effect. There is no local plan, no `IPlanStateStore`, and no restore.
- This SDK does **not** fire a login scenario event (`loginEvent` /
`player_login` is a web-SDK option only). Trigger login-gated scenarios
yourself with `TriggerAsync`.
- An effect with an already-seen `(runId, nodeId)` is not re-emitted.
- An effect with an already-seen `(runId, nodeId)` is not re-emitted. The
seen set is pruned against every pending fetch: keys the server no longer
lists are dropped, so the server stays the source of truth.
- There is no local plan persistence. Pending work lives on the server.
## `ScenarioService` (`client.Scenario`)
@@ -210,7 +212,9 @@ public sealed class ScenarioFailedEffect
```
`OnScenarioCompleted` fires when a callback / completed-counter response has
no next effect (the run finished all its nodes).
no next effect (the run finished all its nodes). It also fires when a run
disappears from the pending list with no keys left for it — the server
advanced a wait, the run expired, or another device completed it.
## Reliability
@@ -219,7 +223,7 @@ no next effect (the run finished all its nodes).
`onPurchase`, `onDecline`, `onEnd`, `onClaim`, `onComplete`, `onLevelUp`,
`onPremiumPurchase`. A non-null `effect` in the response is ingested as
the next node; a null/missing effect completes the run.
- `unknown_run`, `run_expired` (`RudderErrorCodes`), and HTTP 404
- `unknown_run`, `run_expired`, `run_not_active` (`RudderErrorCodes`), and HTTP 404
(`RudderNotFoundException`) on a callback or counter call **drop that
run** (forget its seen keys and wait deadlines) and fire
`OnScenarioFailed`.