Skip to content

feat: added silent mode, error subscriber#10

Merged
petruki merged 1 commit into
masterfrom
staging
May 16, 2026
Merged

feat: added silent mode, error subscriber#10
petruki merged 1 commit into
masterfrom
staging

Conversation

@petruki
Copy link
Copy Markdown
Member

@petruki petruki commented May 16, 2026

This pull request introduces comprehensive support for "silent mode" fallback in the client, allowing the SDK to automatically switch to local evaluation when remote requests fail, and to recover when the remote service becomes healthy again. It also adds a thread-safe error notification subscription mechanism, and includes extensive tests for silent mode behavior. Several code refactorings separate snapshot and silent mode logic for clarity and maintainability.

Silent mode fallback and recovery:

  • Adds a new client_silent_mode.go file implementing logic for detecting when to use silent mode, updating and clearing the silent mode token, and checking remote health to restore normal operation. The Switcher now uses this logic to transparently fall back to local evaluation and recover when possible. [1] [2] [3] [4]

Error notification subscription:

  • Introduces a thread-safe SubscribeNotifyError mechanism to allow clients to register a callback for remote errors, both globally and per-client. This enables applications to be notified when the SDK falls back to silent mode due to remote errors. [1] [2] [3]

Testing and reliability:

  • Adds client_silent_mode_test.go with thorough tests covering fallback, error notification, recovery, and edge cases where no snapshot is available.

Code organization and refactoring:

  • Moves snapshot-related concurrency logic to a new client_snapshot.go file for better separation of concerns and maintainability.

Documentation update:

  • Updates the README.md to clarify how remote connect timeouts affect silent mode fallback responsiveness.

@petruki petruki self-assigned this May 16, 2026
@petruki petruki added enhancement New feature or request ai-generated Indicates that AI tools were used to generate this change labels May 16, 2026
@sonarqubecloud
Copy link
Copy Markdown

@petruki petruki merged commit 93db40e into master May 16, 2026
7 checks passed
@petruki petruki deleted the staging branch May 16, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Indicates that AI tools were used to generate this change enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant