imbajin opened a new pull request, #833: URL: https://github.com/apache/hugegraph-toolchain/pull/833
## Purpose of the PR Keep large interactive Gremlin results and properties from overwhelming the query page, while preserving existing aggregation and asynchronous execution semantics. ## Main Changes - Reuse the existing read grammar and one limiter entry point: default recognized unbounded reads to the configured 300 results and insert before terminal consumers. Support common bare anonymous traversals and HugeGraph Text.contains without a second query whitelist or suffix fallback. - Opt-in preview requests use a 1,001-row upstream sentinel and return at most 1,000 items; graph previews retain at most 1,000 vertices and the configured edge budget. Ordinary API callers can retain raw results; async query text is unchanged. - Project detached data once before graph extraction. Graph/JSON/Table share this bounded source; newly enriched elements consume the same budget without charging projected properties twice. - Bound text, collections, nesting, paths and projection work at centralized defaults. Omit unreadable keys before copying them; batch Path construction. Preserve IDs and label/endpoints. - Mark only elements with partial properties read-only, using two ID arrays that match the actual SDK graph wire representation. Complete neighbors remain editable; keep existing export/reload markers and import rejection for partial previews. Older responses without element metadata retain conservative protection. - Preflight common explicit large limits before POST and direct users to the existing async mode. Bound active JSON conversion and graph work; scale default layout iterations while preserving explicit settings. - Parse/localize/redact query errors before a single final 2,048-character bound, preserving error-code/status mapping. This is a frontend/backend safety net, not a general Groovy query optimizer. Complex scripts retain their existing path. ## Verifying these changes - [x] Independent cross-review of query semantics, projection order, editing and errors. - [x] Final combined source: 186 backend tests passed with candidate SDK gate and Checkstyle; 401 frontend tests passed in 18 affected suites. Production i18n/TypeScript/Vite build passed. - [x] Independent query-branch backend checks passed. Real TinkerGraph execution over 1,500 vertices verifies default/preview counts, consumer types and complete aggregation input. - [x] 1,000 vertices × 10 short properties: removing only the already-projected-map guard makes the regression fail with ten fields reduced to one budget marker; restoring it passes. Tests also prove long Path tails are not visited by projection. - [x] Actual HTTP Jackson serializers verify that graph IDs and partial-ID metadata have the same string type/value, including IDs above 2^53. - [x] Live source-built Hubble/hstore: 12,000-vertex/edge small/large-property fixtures verify 300/1,000 limits, numeric limit syntax, toList, count=12,000 and bounded paths. Common repeat(out()).times(2).path() returns 300 with the default flag. - [x] Chromium mixed fixture: complete node edit enabled, partial node edit disabled, zero mutation requests/page errors; original property SHA values unchanged. The 100 KiB/1 MiB fixture still passes and retains original data SHA. Earlier full frontend-run timeouts and subsequent targeted fixes are recorded accurately in VALIDATION.md in #80; the final affected group above is a single green 401-test run, not a claim that the entire frontend suite was rerun. ## Does this PR potentially affect the following parts? - [ ] Nope - [ ] Dependencies (add/update license info) - [x] Modify configurations - [x] The public API - [x] Other affects: interactive query previews and graph editing ## Documentation Status - [ ] `Doc - TODO` - [x] `Doc - Done`: optional performance report/evidence PR #80 - [ ] `Doc - No Need` Limits: the SDK receives complete individual properties before projection; this is not a universal upstream byte or execution budget. Cypher shares frontend preflight and graph caps but not the Gremlin default/row limiter. Existing async results retain the Server's 16 MiB compressed-result limit. Metadata/statistics: #78. Server buffer fix: https://github.com/hugegraph/hugegraph/pull/327. Report #80 remains optional to merge. --- Source community PR: https://github.com/hugegraph/hugegraph-toolchain/pull/79. This upstream draft reuses the same branch. Figure PR numbers refer to that community source. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
