Repository navigation
Conversation
The sqlite backend's queryL1Records() ignored filter.recordIds, so the
v3 /atomic/update handler — which loads the target note via
queryL1Records({ recordIds: [id] }) — received rows from the whole
table and could read another agent's note, failing the ownership check
with a spurious 403 "belongs to a different agent".
Apply the recordIds primary-key filter in memory alongside the existing
isolation-dimension filters, matching the tcvdb backend's documentIds
path. Verified that handleAtomicDelete is unaffected (it deletes via
deleteL1's primary-key path, not through queryL1Records).
Fixes TencentCloud#1027
Signed-off-by: dvd233 <[email protected]>
|
Thank you so much for your attention and contribution! We will arrange an internal review for this PR shortly, and all feedback will be shared right here in the discussion. |
Signed-off-by: dvd233 <[email protected]>
|
The For the important caller, I repeated a small
Those numbers are not production latency; the stronger invariant is the work count: an atomic update currently reads O(table size) rows to return one primary-key record. Would an ID-driven fast path—bounded PK reads followed by the remaining isolation/time predicates—fit here, with the existing query path retained for non-ID scans? I would not block the correctness fix on this, but it seems like a useful small follow-up before large standalone stores make the point lookup unexpectedly expensive. AI-assisted source review + isolated local SQLite microbenchmark; no full MemoryCore benchmark was run. |
Signed-off-by: dvd233 <[email protected]>
38aa932 to
797cbc2
Compare
|
Independent verification on head
This directly addresses #1027 and looks ready for maintainer merge. The only execution gap is that I did not run an external production database corpus; all verification used real temporary SQLite databases. |
Description | 描述
Fixes #1027.
queryL1Records({ recordIds })must return the requested records rather than an unrelated first row from the table.Use one prepared primary-key lookup per distinct requested ID with the same complete result columns. Preserve session-ID precedence, strict updated-time filtering, chronological ordering, and team/user/agent/task filters. An empty ID list retains the existing scan behavior. This also avoids scanning the table merely to filter a small set of IDs afterwards.
Verification | 验证
npm run buildis not passing: the existingbuild:seed-v2script references a missingscripts/seed-v2/tsconfig.json. The package scripts and missing path are unchanged; the same complete-build failure was reproduced at the original fix(core): keep Node's global proxy dispatcher when loading undici@8 #1171 head on the shared baseline.DCO | 签署
The author confirmed the DCO submission rights and authorized correcting the two existing commits. Their code trees, author/committer metadata, and upstream parent are unchanged; only their own DCO trailers and the necessarily regenerated merge signature changed. The follow-up commit also carries the author's sign-off. Recovery refs retain the original commits.
Prepared and verified with Codex assistance. Automated verification does not replace maintainer review or establish official CI success.