OSIS _find dispatch drops typed FindParams — every filter returns the unfiltered union #140

Closed
opened 2026-05-25 11:34:36 +00:00 by timur · 1 comment
Owner

Context

Every <RootObject>_find call against an OSIS service returns every row of the type regardless of the filter the caller passed. The dispatch adapter (crates/osis/src/rpc/rpc2_adapter.rs::extract_data) pre-dates the typed _find introduced by hero_rpc#123 — it still extracts params.query (the legacy text-search string), but the typed API sends params.params (a <RootObject>FindParams object).

When the lookup misses, extract_data returns the empty string. handle_rpc_call then parses that into an empty JSON object and forwards it to the generated <type>_rpc_find handler, which does params.get("params")None → falls back to IndexedMultiFindParams::default() (all-None filters). to_indexer_query lowers that to the discriminator-only _type = <type> query, which matches every row of that type.

Symptom on the hero_service E2E suite: every indexed_multi_find_* / indexed_single_find_* / indexed_non_str_find_* test returns the full seeded set. Bypassing the OSIS dispatch (crates/osis/tests/indexer_smoke.rs) works correctly — the bug is purely in the wire-to-handler hop.

Goals

  • extract_data("find", ...) preserves the whole params wrapper (same shape as "new"/"set") so the typed FindParams reaches the dispatcher intact.
  • The existing extract_data_find_pulls_query unit test is replaced with a _preserves_typed_params_wrapper test that pins the new contract.
  • cargo test --workspace --test indexed_multi_find_e2e against hero_service @ fe8c78ad: 6/7 green (the remaining title_prefix failure is a separate hero_indexer case-sensitivity bug, filed as hero_indexer#TBD).
## Context Every `<RootObject>_find` call against an OSIS service returns **every row of the type** regardless of the filter the caller passed. The dispatch adapter (`crates/osis/src/rpc/rpc2_adapter.rs::extract_data`) pre-dates the typed `_find` introduced by hero_rpc#123 — it still extracts `params.query` (the legacy text-search string), but the typed API sends `params.params` (a `<RootObject>FindParams` object). When the lookup misses, `extract_data` returns the empty string. `handle_rpc_call` then parses that into an empty JSON object and forwards it to the generated `<type>_rpc_find` handler, which does `params.get("params")` → `None` → falls back to `IndexedMultiFindParams::default()` (all-`None` filters). `to_indexer_query` lowers that to the discriminator-only `_type = <type>` query, which matches every row of that type. Symptom on the hero_service E2E suite: every `indexed_multi_find_*` / `indexed_single_find_*` / `indexed_non_str_find_*` test returns the full seeded set. Bypassing the OSIS dispatch (`crates/osis/tests/indexer_smoke.rs`) works correctly — the bug is purely in the wire-to-handler hop. ## Goals - `extract_data("find", ...)` preserves the whole params wrapper (same shape as `"new"`/`"set"`) so the typed `FindParams` reaches the dispatcher intact. - The existing `extract_data_find_pulls_query` unit test is replaced with a `_preserves_typed_params_wrapper` test that pins the new contract. - `cargo test --workspace --test indexed_multi_find_e2e` against hero_service @ `fe8c78ad`: 6/7 green (the remaining `title_prefix` failure is a separate hero_indexer case-sensitivity bug, filed as hero_indexer#TBD).
Author
Owner

Completed

Fixed in PR #141 (squash-merged into development).

  • crates/osis/src/rpc/rpc2_adapter.rs::extract_data now treats "find" like "new"/"set" — the whole params wrapper ({"ctx": null, "params": <FindParams-JSON>}) passes through to the dispatcher, which deserialises the typed FindParams from params.params.
  • Replaced the misleading extract_data_find_pulls_query unit test with extract_data_find_preserves_typed_params_wrapper.

Verification

  • cargo test --features rpc --lib rpc2_adapter — 9/9 pass.
  • hero_service @ fe8c78ad E2E: indexed_multi_find_* 6/7 → 7/7 after pairing with hero_indexer#31; indexed_single_find_* and indexed_non_str_find_* likewise green.
  • indexed_multi_full_lifecycle, greeter_*, bench_e2e — no regressions.
## Completed Fixed in PR #141 (squash-merged into `development`). - `crates/osis/src/rpc/rpc2_adapter.rs::extract_data` now treats `"find"` like `"new"`/`"set"` — the whole params wrapper (`{"ctx": null, "params": <FindParams-JSON>}`) passes through to the dispatcher, which deserialises the typed `FindParams` from `params.params`. - Replaced the misleading `extract_data_find_pulls_query` unit test with `extract_data_find_preserves_typed_params_wrapper`. ## Verification - `cargo test --features rpc --lib rpc2_adapter` — 9/9 pass. - hero_service @ `fe8c78ad` E2E: `indexed_multi_find_*` 6/7 → 7/7 after pairing with hero_indexer#31; `indexed_single_find_*` and `indexed_non_str_find_*` likewise green. - `indexed_multi_full_lifecycle`, `greeter_*`, `bench_e2e` — no regressions.
timur closed this issue 2026-05-25 11:42:55 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_blueprint#140
No description provided.