GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix value cache batch loader environment by andimarek · Pull Request #278 · graphql-java/java-dataloader

Conversation

@andimarek

@andimarek andimarek commented May 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This is a demonstration patch stacked on top of #277. It addresses the BatchLoaderEnvironment semantic regression described in the requested-changes review.

Problem

#277 builds a BatchLoaderEnvironment before value-cache filtering. If a dispatch has a partial ValueCache hit, the actual batch loader is invoked only with the missed keys, but the environment can still describe the original full key/context list.

That breaks the existing invariant that environment.getKeyContextsList() is aligned with the keys argument received by a BatchLoaderWithContext.

Fix

When ValueCache filtering produces missedKeys, build a fresh BatchLoaderEnvironment from missedKeys and missedKeyContexts before invoking the concrete batch loader.

The actual fix is intentionally small:

  • src/main/java/org/dataloader/DataLoaderHelper.java:483 builds missedEnvironment from missedKeys and missedKeyContexts.
  • src/main/java/org/dataloader/DataLoaderHelper.java:484 passes missedEnvironment into the concrete invokeLoader(...) call for the cache misses.

GitHub line link:
https://github.com/graphql-java/java-dataloader/blob/fix-pr-277-value-cache-environment/src/main/java/org/dataloader/DataLoaderHelper.java#L483-L484

Test

Adds a regression test where:

  • A is returned from ValueCache
  • B misses and is sent to the batch loader
  • the batch loader asserts it receives only B
  • environment.getKeyContextsList().get(0) matches B's context, not A's

The key test lines are:

  • src/test/java/org/dataloader/DataLoaderBatchLoaderEnvironmentTest.java:221-249

GitHub line link:
https://github.com/graphql-java/java-dataloader/blob/fix-pr-277-value-cache-environment/src/test/java/org/dataloader/DataLoaderBatchLoaderEnvironmentTest.java#L221-L249

Verification

  • ./gradlew test --tests org.dataloader.DataLoaderBatchLoaderEnvironmentTest
  • ./gradlew test
  • git diff --check origin/pr/277

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
bbakerman and others added 4 commits May 17, 2026 12:47
@bbakerman
Allow scheduling of CF completion
3075fcc
@bbakerman
Allow scheduling of CF completion
8eadcb2
@fxbonnet
Allow BatchLoaderScheduler process all CF completions as a batch and …
e04c76d
…potentially in parallel
@andimarek
Fix value cache batch loader environment
e029423
@andimarek andimarek mentioned this pull request May 20, 2026
Allow scheduling of CF completion in parallel #277
Open
@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown

Hello, this pull request has been inactive for 60 days, so we're marking it as stale. If you would like to continue working on this pull request, please make an update within the next 30 days, or we'll close the pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the Stale label Jul 20, 2026
@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown

Hello, as this pull request has been inactive for 90 days, we're closing this pull request. We always welcome contributions, and if you would like to continue, please open a new pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot closed this Aug 20, 2026
@andimarek andimarek reopened this Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

Stale

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@andimarek @bbakerman @fxbonnet
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.