You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
seems impossible to click save in case of shoddy network in category editing #7746
Story:
seems impossible to click save in case of shoddy network in category editing
Ended up on black screen after some time. Back gesture closed the app
I've traced the category/details editing save path (SimpleInputPage → BackgroundTaskDetails → BackgroundTaskManager) and confirmed it's designed to be non-blocking — preExecute() is local-only, and the actual OpenFoodAPIClient.saveProduct() call runs via unawaited() dispatch, not on the save button's await chain. So I don't believe the save button itself is the direct freeze point.
I did find a concrete issue in SmoothAutocompleteTextField.getSuggestions() (used for the category autocomplete while typing): the network call await widget.manager!.getSuggestions(search) has no timeout, and errors are silently swallowed (catch () {}), with no visible cancellation of stale in-flight requests. On poor network, this could leave multiple hanging requests and a stuck loading spinner.
That said, I want to be upfront: a plain hanging Future shouldn't normally freeze the whole Flutter UI/render thread the way "black screen + back gesture closes the app" suggests, so I'm not fully confident this explains the entire reported behavior on its own. Before I finalize a fix, could someone confirm:
Does the freeze happen while typing in the category field, or only after tapping Save?
Android, iOS, or both?
Any crash logs/stack traces from the black-screen event?
Happy to submit a PR for the autocomplete timeout/cancellation fix regardless, since it's a real issue — but want to make sure I'm also addressing the actual reported freeze, not just a related bug nearby.
@teolemon I couldn't reproduce the black screen on a Galaxy S20, even with downloads throttled to 100 B/s. Save always closed the page right away and the upload finished in the background. What I did see is the suggestion list covering Save while the keyboard is up, so I'm fixing that in a PR. Do you remember whether it got stuck while typing or after tapping Save, and on Android or iOS?
Activity
Yeasin00p commentedon Sep 11, 2026
Hi @openfoodfacts team!
I've traced the category/details editing save path (SimpleInputPage → BackgroundTaskDetails → BackgroundTaskManager) and confirmed it's designed to be non-blocking — preExecute() is local-only, and the actual OpenFoodAPIClient.saveProduct() call runs via unawaited() dispatch, not on the save button's await chain. So I don't believe the save button itself is the direct freeze point.
I did find a concrete issue in SmoothAutocompleteTextField.getSuggestions() (used for the category autocomplete while typing): the network call await widget.manager!.getSuggestions(search) has no timeout, and errors are silently swallowed (catch () {}), with no visible cancellation of stale in-flight requests. On poor network, this could leave multiple hanging requests and a stuck loading spinner.
That said, I want to be upfront: a plain hanging Future shouldn't normally freeze the whole Flutter UI/render thread the way "black screen + back gesture closes the app" suggests, so I'm not fully confident this explains the entire reported behavior on its own. Before I finalize a fix, could someone confirm:
Does the freeze happen while typing in the category field, or only after tapping Save?
Android, iOS, or both?
Any crash logs/stack traces from the black-screen event?
Happy to submit a PR for the autocomplete timeout/cancellation fix regardless, since it's a real issue — but want to make sure I'm also addressing the actual reported freeze, not just a related bug nearby.
Thanks!
UrbanFercec commentedon Oct 25, 2026
Hi @Yeasin00p, are you still planning a PR for this? If not, I'm happy to take it over.
Yeasin00p commentedon Oct 26, 2026
Hi,@UrbanFercec thanks for following up! I’m not actively working on the PR at the moment, so please feel free to take it over.
UrbanFercec commentedon Oct 27, 2026
@teolemon I couldn't reproduce the black screen on a Galaxy S20, even with downloads throttled to 100 B/s. Save always closed the page right away and the upload finished in the background. What I did see is the suggestion list covering Save while the keyboard is up, so I'm fixing that in a PR. Do you remember whether it got stuck while typing or after tapping Save, and on Android or iOS?