Commit 4046315
feat(audience): surface consent persistence failures via OnError (SDK-147)
ConsentStore.Save can fail from transient I/O (disk full, locked file,
permissions). Previously the catch handler at ImmutableAudience.cs:318
logged a warning and returned silently - studios had no programmatic
signal that their consent change wouldn't survive a restart.
Adds AudienceErrorCode.ConsentPersistFailed, distinct from
ConsentSyncFailed (backend PUT) so operators can tell the two failure
modes apart: a Save failure means local state will revert on relaunch,
a Sync failure means the backend audit trail is out of sync but local
state is fine.
In-memory behaviour is unchanged - the new level still applies to the
current session, the purge/downgrade still runs. The callback just
gives studios a hook to warn the player, log to their telemetry, or
retry the persist at a better moment.
New test pre-creates a directory at the consent file path to force
File.Move to fail, then asserts ConsentPersistFailed reaches OnError.
155 passing.
Linear: SDK-147
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 7f3b250 commit 4046315
3 files changed
Lines changed: 29 additions & 1 deletion
File tree
- src/Packages/Audience
- Runtime
- Tests/Runtime
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
| 325 | + | |
| 326 | + | |
325 | 327 | | |
326 | 328 | | |
327 | 329 | | |
| |||
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
596 | 596 | | |
597 | 597 | | |
598 | 598 | | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
599 | 623 | | |
600 | 624 | | |
601 | 625 | | |
| |||
0 commit comments