Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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:
client_silent_mode.gofile implementing logic for detecting when to use silent mode, updating and clearing the silent mode token, and checking remote health to restore normal operation. TheSwitchernow uses this logic to transparently fall back to local evaluation and recover when possible. [1] [2] [3] [4]Error notification subscription:
SubscribeNotifyErrormechanism 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:
client_silent_mode_test.gowith thorough tests covering fallback, error notification, recovery, and edge cases where no snapshot is available.Code organization and refactoring:
client_snapshot.gofile for better separation of concerns and maintainability.Documentation update:
README.mdto clarify how remote connect timeouts affect silent mode fallback responsiveness.