fix: drop empty label from network errors#21350
Closed
criticalAY wants to merge 1 commit into
Closed
Conversation
The backend appends its localized line to network errors even when there's nothing to fill it, leaving a dangling label in the error dialog. Strip it before showing. The label is read from the translations, so this works in any language. Assisted-By: Claude Opus 4.8 (analysing the upstream cause)
Member
|
I feel this should be fixed upstream, unless we're deviating from their behaviour. If we still want to do it here, we should add a test which fails when upstream have fixed the issue, so we can remove the dead code |
Contributor
Author
|
I would incline with later we can remove this once upstream actually ships it since I am not sure how long it would take |
Member
|
I'll leave the question open for Reviewer 2. If we are continuing, please see if you can detect when this code is no longer necessary via a test
|
Member
|
it's less work to send a patch to upstream then consume it here |
Contributor
Author
|
Sure: ankitects/anki#5120 |
Contributor
Author
|
Closing in favour of the upstream fix(merged): |
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.
Note
Assisted-By: Claude Opus 4.8 - analysing the upstream cause and testing the fix
Purpose / Description
When a sync fails with a network error (e.g. AnkiWeb is down or unreachable), the error dialog shows a dangling "Error details:" label with nothing after it. There are simply no details to show, so the bare label looks unfinished. This pr cleans that
Also i have opened an issue upstream:
Fixes
Approach
stripEmptyErrorDetails()inCoroutineHelpers.ktto drop that trailing label before the message is shownHow Has This Been Tested?
unit testing
Learning (optional, can help others)
Describe the research stage
Links to blog posts, patterns, libraries or addons used to solve this problem
Checklist
Please, go through these checks before submitting the PR.