Skip to content

fix(core): match a session exactly in the session view and index source - #1679

Merged
ajianaz merged 1 commit into
developfrom
fix/session-view-exact-match
Nov 4, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/session-view-exact-match

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

What

session_memories now matches capture:<session>:<batch> exactly (after the prefix only a batch id without : may follow) with an equality + range predicate on source, and schema v25 adds idx_memories_source.

Why

The substr prefix test returned the memories of session a:b in the view of session a, and it could not use an index, so each viewer request scanned the table. The session view is unreleased (only on develop), so no compatibility shim; noted in the CHANGELOG.

Closes #1670

Testing

  • a / a:b / a:b:c each see only their own memories; ids with %, _, ' and ; are literal.
  • EXPLAIN QUERY PLAN of the real query uses idx_memories_source and has no SCAN memories.
  • Migration test: a v24 store upgrades to v25, keeps its data and has the index.
  • cargo test -p uteke-core --lib, cargo clippy -p uteke-core --all-targets, cargo fmt.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 75e5528 into develop Nov 4, 2026
15 checks passed
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.

fix(core): the session view mixes sessions whose ids contain a colon and scans every memory

1 participant