Skip to content

Don't compute sha256 of empty persisted operation bodies #2238

@robmyersrobmyers

Description

@robmyersrobmyers

Component(s)

router

Component version

router@0.252.3

wgc version

latest

controlplane version

n/a

router version

router@0.252.3

What happened?

Description

The router computes sha256 hashes of operations with empty bodies, even if the persisted operation hash is already present. This breaks fetching the operation body from the cache because it is looking for the e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 hash in the cache, which does not match the supplied hash.

According to the documentation, persisted operations without the body should be supported.

Here is a link to a fix I'm testing.

Steps to Reproduce

  1. Configure router for persisted operations
  2. Configure persisted query manifest
  3. Follow documentation to execute a persisted operation with a hash but without a query body

Expected Result

Persisted operations without query bodies execute without issue.

Actual Result

An "Unknown persisted operation" error is thrown with this hash: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

That hash is the hash of ""

Environment information

Environment

Compiler(if manually compiled): go version go1.25.1 darwin/arm64

Router configuration

Router execution config

Log output

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinginternally-reviewedThe issue has been reviewed internally.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions