The short search screen shows a text query and a list of suggestions under the input field. After a recent PR, the screen started behaving unstably: when typing quickly, you can see a result for not the latest query, and leaving the screen sometimes does not stop an already started load.
SearchHeaderModel stores the current query, suggestions, and isLoading.SuggestionService.DelayedSuggestionService.await model.updateQuery("s")
await model.updateQuery("sw")
suggestions may correspond to not the latest query.updateQuery("swift"), and immediately release the model.CancellationError, the model must not switch to a false "successful completion" state and must not overwrite already valid data.Swift 6Task, actor isolation via @MainActor1 character is slower than 2+ characters)Use line comments to explain the problem, its impact, the fix and how to test it.