Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces robust error handling for network failures when fetching survey metadata in SurveyService by catching ClientException and logging it, preventing unhandled exceptions. It also adds comprehensive unit tests using MockClient to cover various success, failure, and recovery scenarios. The review feedback points out that the release note entry should be updated to use the past tense ('Handled' instead of 'Handle') to adhere to the repository style guide.
Comment on lines
+18
to
+19
| * Handle network failures when fetching survey metadata without an unhandled | ||
| exception. [#8562](https://github.com/flutter/devtools/issues/8562) |
Contributor
There was a problem hiding this comment.
[CONCERN] Release note entries must be written in the past tense (e.g., 'Handled' instead of 'Handle') to adhere to the repository style guide.
Suggested change
| * Handle network failures when fetching survey metadata without an unhandled | |
| exception. [#8562](https://github.com/flutter/devtools/issues/8562) | |
| * Handled network failures when fetching survey metadata without an unhandled | |
| exception. [#8562](https://github.com/flutter/devtools/issues/8562) |
References
- Entries are past tense (e.g. 'Added ...'), and the sentence ends with a period. (link)
This branch has not been deployed
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.
Addresses the survey-metadata request failure in #8562.
The issue's screenshot shows a
ClientExceptionfrom the survey metadata URL.fetchSurveyContentcatchesError, which does not catch this exception. When offline, the request can throw an uncaught exception.Catch
ClientException, log it at fine level, and return no survey. Keep the existing handling of non-200 responses and metadata type errors. Other exceptions retain their existing behavior. This does not address the separate font-loading problem mentioned in the discussion.The tests now use
MockClientinstead of making a real network request, including a failed request followed by a successful one. A release note is included.Testing
dt presubmitpassed, including analysis and formatting checks.ClientExceptionon the original code; the patched app handled the same failure. Navigation and Settings remained usable. After removing the block and reloading, the metadata request returned HTTP 200.The manual check targets the survey request. It does not test every offline feature.
Tests use the repository's pinned Flutter SDK. Dependency resolution follows
flutter pub get; no dependency or lockfile changes are included in this PR.Pre-launch Checklist
General checklist
///).Issues checklist
contributions-welcomeorgood-first-issuelabel.contributions-welcomeorgood-first-issuelabel. I understand this means my PR might take longer to be reviewed.Tests checklist
AI-tooling checklist
Feature-change checklist
release-notes-not-requiredlabel or left a comment requesting the label be added.packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md.If you need help, consider asking for help on Discord.