Skip to content

fix(result): lazy-load large text values - #2882

Merged
openai0229 merged 2 commits into
mainfrom
fix/large-jsonb-table-results
Sep 7, 2026
Merged

openai0229 merged 2 commits into
mainfrom
fix/large-jsonb-table-results

Conversation

@openai0229

@openai0229 openai0229 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Related issue

N/A - no existing issue covers this regression.

Summary

Treat text-like and binary values larger than 10 KiB as lazy-loaded cells and keep only a 200-character preview in initial query results. This prevents large JSON/JSONB result pages from exceeding the desktop response serializer's large-object limit.

Keep large-value identity and actions intact when JSON is formatted or compressed in the value inspector, and reset the editor viewport to the start of the transformed content.

Affected surfaces

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

Verification

  • Commands and results:
    • yarn eslint src/blocks/SearchResult/components/ViewData/index.tsx src/blocks/SearchResult/components/ViewData/JsonAwareMonacoEditor.tsx - passed.
    • yarn tsx src/blocks/SearchResult/components/ViewData/largeCellValue.test.ts - passed.
    • mvn -B -f chat2db-community-server/pom.xml -pl :chat2db-community-spi,:chat2db-community-domain-core -am -Dmaven.test.skip=false -DskipTests=false -Dtest=JDBCDataValueLargeCellTest,LargeValueTokenServiceTest -Dsurefire.failIfNoSpecifiedTests=false -Dmaven.test.failure.ignore=false test - 12 tests passed.
  • Manual verification: Queried 1,000 rows from a 30-column PostgreSQL table whose JSONB value is about 64 KiB per row. The initial result completed without the previous serializer error, returned previews, and loaded complete JSONB values on demand by primary key. JSON format/compress retained the large-value controls.
  • UI evidence: Manually verified the result grid and value inspector before and after JSON formatting.

Risk and compatibility

  • Public API or stored data: Response fields are unchanged; large eligible values now contain a bounded preview and existing large-value metadata.
  • Database or driver compatibility: Uses the existing type classification and token-based read path. The threshold is measured in UTF-8 bytes.
  • Network, privacy, or security: No new network operations or data exposure.
  • Community / Local / Pro boundary: Community behavior only; no product-boundary changes.
  • Backward compatibility: Small values and pre-existing LOB summaries retain their prior behavior. Results without a stable primary-key locator continue to expose only the preview for large values; lowering the threshold extends that existing limitation to values above 10 KiB.

Reviewer map

  • Start here: JDBCDataValue.buildResultCell for threshold/preview behavior, then ViewData.applyJsonPresentation for inspector state.
  • Failure condition: Large JSON/JSONB result pages still serialize full cell values, or JSON formatting removes large-value actions.
  • Rollback or disable path: Revert this commit to restore the previous 1 MiB inline behavior and inspector formatting flow.

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: Substantial AI assistance was used for diagnosis, implementation, review, and test execution.

@openai0229
openai0229 merged commit 0027505 into main Sep 7, 2026
14 of 16 checks passed
@openai0229
openai0229 deleted the fix/large-jsonb-table-results branch September 7, 2026 13:00
@openai0229 openai0229 moved this from In Review to Done in Chat2DB Community Sep 7, 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.

1 participant