Skip to content

[codex] fix(history): preserve full SQL behind previews - #2311

Merged
openai0229 merged 2 commits into
OtterMind:mainfrom
HanawaBanana:codex/history-preview-preserve-full-sql
Jul 28, 2026
Merged

[codex] fix(history): preserve full SQL behind previews#2311
openai0229 merged 2 commits into
OtterMind:mainfrom
HanawaBanana:codex/history-preview-preserve-full-sql

Conversation

@HanawaBanana

Copy link
Copy Markdown
Contributor

Related issue

Closes #2310

Summary

Operation-log previews previously truncated the same OperationLog instances held by local storage. After a user opened the history list, fetching an entry's details returned the shortened SQL until the backend restarted.

This change copies each operation log before preparing its 200-character preview. The list response keeps its existing truncation and more=true behavior, while the stored object and subsequent detail response retain the full SQL. A focused regression test covers the list-then-detail sequence and verifies that preview and storage objects are independent.

Affected surfaces

  • Frontend / Web
  • Backend / API / Storage
  • Database plugin / Driver
  • JCEF / Desktop packaging
  • CI / Build / Release
  • Documentation only

Verification

  • Commands and results:
    • Before the implementation change, the focused regression command reported Tests run: 1, Failures: 1, Errors: 0; the failure showed that the preview and stored log were the same instance.
    • mvn -B -f chat2db-community-server/pom.xml -pl :chat2db-community-domain-core -am -Dmaven.test.skip=false -DskipTests=false -Dtest=OpsOperationLogQueryServiceImplTest -Dsurefire.failIfNoSpecifiedTests=false -Dmaven.test.failure.ignore=false test -> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0; reactor BUILD SUCCESS.
    • mvn -B -f chat2db-community-server/pom.xml -pl :chat2db-community-domain-core -am -Dmaven.test.skip=true package -> all 7 reactor modules succeeded. Tests were explicitly skipped in this packaging pass and are covered by the focused command above.
    • git diff --check -> passed.
  • Manual verification: N/A; the regression test exercises the storage aliasing and list-then-detail service sequence directly.
  • UI evidence: N/A

Risk and compatibility

  • Public API or stored data: No API, serialization, or storage-format changes. The service now transforms response copies instead of storage-owned instances.
  • Database or driver compatibility: N/A; the behavior is database-independent.
  • Network, privacy, or security: N/A; no network or security behavior changes.
  • Community / Local / Pro boundary: The change stays within the Community domain service and does not alter runtime edition selection.
  • Backward compatibility: Existing preview length, ellipsis, more flag, ordering, and pagination metadata are preserved.

Reviewer map

  • Start here: OpsOperationLogQueryServiceImpl.operationLogPreviewList; preparePreview now copies the input before truncation.
  • Failure condition: Listing a SQL statement longer than 200 characters must not change the object later returned by getOperationLog.
  • Rollback or disable path: Revert commit 137b2874; there is no data migration or configuration change.

Contributor declaration

  • I linked the Issue that defines this change.
  • I tested the affected behavior and reported the actual results above.
  • I did not include credentials, private data, or generated build output.
  • I disclosed substantial AI assistance below, or this PR contains no substantial AI-generated code.

AI assistance: OpenAI Codex traced the affected call path with CodeGraph, authored the focused implementation and regression test, and ran the verification commands reported above.

@openai0229
openai0229 marked this pull request as ready for review July 28, 2026 12:03
@openai0229
openai0229 self-requested a review as a code owner July 28, 2026 12:03
@openai0229 openai0229 moved this from In Progress to In Review in Chat2DB Community Jul 28, 2026
@openai0229
openai0229 merged commit 5d952ba into OtterMind:main Jul 28, 2026
20 of 25 checks passed
@openai0229 openai0229 moved this from In Review to Done in Chat2DB Community Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug(history): operation log previews truncate full SQL details

2 participants