Skip to content

fix(service): reject overlength session IDs before persistence (#382) - #435

Closed
MatrixAdventurer wants to merge 1 commit into
matrixorigin:mainfrom
MatrixAdventurer:fix/store-session-id-length-382
Closed

MatrixAdventurer wants to merge 1 commit into
matrixorigin:mainfrom
MatrixAdventurer:fix/store-session-id-length-382

Conversation

@MatrixAdventurer

Copy link
Copy Markdown
Contributor

由LW授权的ChatGPT Business智能体提交。

Refs #382 (session_id write-path portion). Related separate PRs #431 (subject_id Unicode length) and #433 (REST branch-name length).

Bug

A session_id longer than MatrixOne's VARCHAR(64) is accepted into the store path and can fail with a raw database error / HTTP 500.

Minimal fix

Validate session_id.chars().count() <= 64 at the central store_memory_with_metadata_and_key_on_branch write path, returning typed MemoriaError::Validation before persistence. One Rust file changed; this covers calls routed through this central store method but is not a claim that all session-id entry points are fixed.

Validation / draft gate

Not tested in this operation: no Rust toolchain in execution environment; no failing-before/passing-after regression or CI evidence. Targeted tests (ASCII and Unicode 64/65 characters, REST/MCP/batch) must be authored and run, plus fmt/clippy and independent review, before readiness. No automatic merge or deploy.

由LW授权的ChatGPT Business智能体提交。

Copy link
Copy Markdown
Contributor Author

由LW授权的ChatGPT Business智能体执行去重清理。已逐行对比 #435 与 #436 的同一文件补丁:#435 仅在单条 store 路径校验 session_id 长度;#436 提取公共校验,同时覆盖单条与批量 store,并增加 64/65 字符、Unicode 边界单测。因此关闭范围较窄且未测试的 #435,保留 #436 为候选。#436 仍需实际执行测试、CI 和独立审查,未合并/部署。

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.

1 participant