Skip to content

Parse Typesense multi_search errors#1208

Merged
wesbillman merged 1 commit into
mainfrom
perci/search-no-match-500
Jun 23, 2026
Merged

Parse Typesense multi_search errors#1208
wesbillman merged 1 commit into
mainfrom
perci/search-no-match-500

Conversation

@tlongwell-block

@tlongwell-block tlongwell-block commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • parse Typesense multi_search per-result {code, error} responses as SearchError::Api so schema/filter failures are diagnosable
  • keep the HTTP /query bridge search contract unchanged: it still pushes channel_id filters into Typesense
  • leaves the actual user-facing fix to schema repair/reindex of the stage events collection so the index matches the code's expected schema

Root cause

Stage's events Typesense collection appears to predate the channel_id facet field, even though the current Buzz search schema includes it:

{"name": "channel_id", "type": "string", "facet": true, "optional": true}

Typesense multi_search can return HTTP 200 with a per-result error like:

{ "code": 400, "error": "Could not find a filter field named `channel_id` in the schema." }

Before this PR, the search client tried to deserialize that per-result error as a normal search response, which hid the real Typesense error behind a JSON parse failure.

Fix direction

channel_id is part of the index/query contract, so this PR no longer works around missing channel_id by weakening bridge filtering. The better fix is to repair/recreate the stage events collection with the current schema and reindex it. See #1209.

Tests

  • ./bin/cargo test -p buzz-search --lib query::
  • pre-commit hook: rust fmt, desktop Tauri fmt, web/desktop biome + file-size checks, mobile format/analyze passed during amend
  • pre-push hook: rust, desktop, mobile, and Tauri tests passed

@tlongwell-block tlongwell-block force-pushed the perci/search-no-match-500 branch from 420da82 to 13f1fff Compare June 23, 2026 18:51
@tlongwell-block tlongwell-block changed the title Fix bridge search 500s on old Typesense indexes Parse Typesense multi_search errors Jun 23, 2026
Surface per-result Typesense multi_search failures as API errors instead of losing the useful error body during JSON parsing.

Co-authored-by: npub1t2tgm7d8f995uqvmnm8h88sg3wnpp9a5xysjf6dg3tjmgt3ltulqdp8ehr <5a968df9a7494b4e019b9ecf739e088ba61097b4312124e9a88ae5b42e3f5f3e@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1t2tgm7d8f995uqvmnm8h88sg3wnpp9a5xysjf6dg3tjmgt3ltulqdp8ehr <5a968df9a7494b4e019b9ecf739e088ba61097b4312124e9a88ae5b42e3f5f3e@sprout-oss.stage.blox.sqprod.co>
@tlongwell-block tlongwell-block force-pushed the perci/search-no-match-500 branch from 13f1fff to f106bd4 Compare June 23, 2026 19:12
@wesbillman wesbillman merged commit 65ccb12 into main Jun 23, 2026
29 checks passed
@wesbillman wesbillman deleted the perci/search-no-match-500 branch June 23, 2026 21:16
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.

2 participants