Skip to content

fix: handle autocomplete error gracefully in search field (#1950)#2052

Open
gauravsaini wants to merge 1 commit into
ubuntu:mainfrom
gauravsaini:fix/search-crash-error-handling-1950
Open

fix: handle autocomplete error gracefully in search field (#1950)#2052
gauravsaini wants to merge 1 commit into
ubuntu:mainfrom
gauravsaini:fix/search-crash-error-handling-1950

Conversation

@gauravsaini

Copy link
Copy Markdown

Summary

Problem

When the autocomplete provider throws an error (e.g., SnapDataNotFoundException or network error), the exception propagates uncaught from optionsBuilder to RawAutocomplete, causing the app to freeze and crash.

Changes

  • Modified packages/app_center/lib/search/search_field.dart to catch exceptions in optionsBuilder
  • Added test to verify graceful error handling in packages/app_center/test/search_field_test.dart

When the autocomplete provider throws (e.g., network error or
SnapDataNotFoundException), the search field now returns an empty
options list instead of crashing the application.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash when click on search bar every time

1 participant