Skip to content

[Fusion] Fix SourceResultDocument reading of arrays#9170

Merged
tobias-tengler merged 3 commits intomainfrom
tte/fix-fusion-empty-array
Feb 20, 2026
Merged

[Fusion] Fix SourceResultDocument reading of arrays#9170
tobias-tengler merged 3 commits intomainfrom
tte/fix-fusion-empty-array

Conversation

@tobias-tengler
Copy link
Copy Markdown
Member

Fixes #9169

Copilot AI review requested due to automatic review settings February 20, 2026 16:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes SourceResultDocument raw JSON slicing for array values so that array/empty-array extensions can be parsed and forwarded correctly (addressing #9169 where empty arrays could trigger ServerParseError).

Changes:

  • Fix raw-value boundary calculation for composite JSON values by correctly handling EndArray tokens.
  • Add/extend tests to cover raw text extraction for arrays and forwarding of extension values including empty arrays.
  • Improve debugger visualization for SourceResultDocument / SourceResultProperty.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Text/Json/SourceResultDocument.Text.cs Fixes end-token length computation so raw extraction includes the closing ] for arrays.
src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Text/Json/SourceResultDocument.cs Adds DebuggerDisplay to show document content during debugging.
src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Text/Json/SourceResultProperty.cs Adjusts debugger display formatting for properties.
src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/Text/Json/SourceResultDocumentTests.cs Adds a regression test validating GetRawText/GetRawValueAsMemory for arrays.
src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/SourceSchemaErrorTests.cs Extends error extensions to include scalar, array, and empty-array values.
src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_Extensions_From_Source_Schema_Are_Properly_Forwarded.yaml Updates snapshot to include the new forwarded extension values.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tobias-tengler tobias-tengler changed the title [Fusion] Fix SourceResultDocument parsing of arrays [Fusion] Fix SourceResultDocument reading of arrays Feb 20, 2026
@tobias-tengler tobias-tengler merged commit 7913dd1 into main Feb 20, 2026
117 checks passed
@tobias-tengler tobias-tengler deleted the tte/fix-fusion-empty-array branch February 20, 2026 17:28
@github-actions
Copy link
Copy Markdown
Contributor

Fusion Gateway Performance Results

Simple Composite Query

Req/s Err%
Constant (50 VUs) 2928.89 0.00%
Ramping (0-500-0 VUs) 3344.18 0.00%
Response Times & Query
Min Med Avg P90 P95 Max
Constant 0.76ms 14.95ms 16.85ms 31.02ms 36.39ms 171.22ms
Ramping 0.69ms 64.47ms 66.63ms 123.92ms 141.17ms 267.15ms
query TestQuery {
  topProducts(first: 5) {
    inStock
    name
    price
    shippingEstimate
    upc
    weight
    reviews {
      id
      body
      author {
        id
        username
        name
      }
    }
  }
}

Deep Recursion Query

Req/s Err%
Constant (50 VUs) 748.73 0.00%
Ramping (0-500-0 VUs) 833.99 0.00%
Response Times & Query
Min Med Avg P90 P95 Max
Constant 9.18ms 62.25ms 65.19ms 80.29ms 88.24ms 337.06ms
Ramping 1.83ms 257.43ms 256.88ms 492.45ms 526.39ms 666.50ms
query TestQuery {
  users {
    id
    username
    name
    reviews {
      id
      body
      product {
        inStock
        name
        price
        shippingEstimate
        upc
        weight
        reviews {
          id
          body
          author {
            id
            username
            name
            reviews {
              id
              body
              product {
                inStock
                name
                price
                shippingEstimate
                upc
                weight
              }
            }
          }
        }
      }
    }
  }
  topProducts(first: 5) {
    inStock
    name
    price
    shippingEstimate
    upc
    weight
    reviews {
      id
      body
      author {
        id
        username
        name
        reviews {
          id
          body
          product {
            inStock
            name
            price
            shippingEstimate
            upc
            weight
          }
        }
      }
    }
  }
}

Variable Batching Throughput

Req/s Err%
Constant (50 VUs) 23601.53 0.00%
Ramping (0-500-0 VUs) 18632.45 0.00%
Response Times & Query
Min Med Avg P90 P95 Max
Constant 0.10ms 1.71ms 2.07ms 3.95ms 4.83ms 45.44ms
Ramping 0.10ms 9.28ms 11.29ms 23.26ms 28.04ms 100.25ms
query TestQuery($upc: ID!, $price: Long!, $weight: Long!) {
  productByUpc(upc: $upc) {
    inStock
    shippingEstimate(weight: $weight, price: $price)
  }
}

Variables (5 sets batched per request)

[
  { "upc": "1", "price": 899, "weight": 100 },
  { "upc": "2", "price": 1299, "weight": 1000 },
  { "upc": "3", "price": 15, "weight": 20 },
  { "upc": "4", "price": 499, "weight": 100 },
  { "upc": "5", "price": 1299, "weight": 1000 }
]

Run 22233912726 • Commit e415395 • Fri, 20 Feb 2026 17:39:28 GMT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setting an empty array in extensions causes ServerParseError

2 participants