Fix repetitive crashes in HttpClient and LocalStorage#6
Open
abdallahyassein-dev wants to merge 3 commits intoproductminds:mainfrom
Open
Fix repetitive crashes in HttpClient and LocalStorage#6abdallahyassein-dev wants to merge 3 commits intoproductminds:mainfrom
abdallahyassein-dev wants to merge 3 commits intoproductminds:mainfrom
Conversation
… HTTP client, and update various dependencies.
…and update debug messages to English.
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 PR addresses critical crashes reported in Firebase Crashlytics related to network timeouts, host lookups, and local storage parsing.
Wrapped the HTTP request logic in a try-catch block to handle network-level failures (offline, timeout) gracefully.
Network errors now log a debug warning instead of propagating unhandled exceptions that crash the host app.
Fixed the timeout implementation (previously, the timeout configuration was ignored).
Corrected the retry logic to properly await recursive calls and prevent invalid execution flow after a failure.
2. Fixed LocalStorage Crash (FormatException)
Updated LocalStorage.load to validate that a string looks like a JSON object (starts with {) before attempting to jsonDecode it.
This prevents FormatException crashes when the SDK scans SharedPreferences that contain plain strings (e.g., locale codes like "en") created by other parts of the application.