fix(resolve): guard OnFinished against nil loaderHookContext on skipped fetches#1394
Merged
fix(resolve): guard OnFinished against nil loaderHookContext on skipped fetches#1394
Conversation
…ed fetches When a fetch is skipped (e.g. null parent data), executeSourceLoad never runs, leaving loaderHookContext nil. OnFinished was called with this nil context, causing a panic in the router's header propagation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lel, entity, and batch entity fetch paths Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ipped fetches Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ped-fetch tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
endigma
approved these changes
Feb 19, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughWalkthroughThis PR adds integration and unit test coverage for skipped fetch behavior when a parent entity is null, refactors loader hook finalization to only call OnFinished when hooks were actually invoked, and updates test helpers accordingly. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
This was referenced Feb 19, 2026
jensneuse
pushed a commit
that referenced
this pull request
Feb 19, 2026
🤖 I have created a release *beep* *boop* --- ## [2.0.0-rc.252](v2.0.0-rc.251...v2.0.0-rc.252) (2026-02-19) ### Features * forward headers to grpc subgraphs ([#1382](#1382)) ([8459b34](8459b34)) ### Bug Fixes * **resolve:** fix flaky singleflight deduplication tests ([#1393](#1393)) ([4105082](4105082)) * **resolve:** guard OnFinished against nil loaderHookContext on skipped fetches ([#1394](#1394)) ([f79d071](f79d071)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
jensneuse
pushed a commit
that referenced
this pull request
Feb 19, 2026
🤖 I have created a release *beep* *boop* --- ## [1.8.1](execution/v1.8.0...execution/v1.8.1) (2026-02-19) ### Bug Fixes * **resolve:** fix flaky singleflight deduplication tests ([#1393](#1393)) ([4105082](4105082)) * **resolve:** guard OnFinished against nil loaderHookContext on skipped fetches ([#1394](#1394)) ([f79d071](f79d071)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary by CodeRabbit
Tests
Bug Fixes
Fixes a panic where
LoaderHooks.OnFinishedwas called with a nilcontext.Contextwhen a fetch was skipped (e.g. null parent data, auth rejection, rate limiting). The nil guard is now consolidated in acallOnFinishedhelper that covers all four fetch paths:SingleFetch,EntityFetch,BatchEntityFetch, and the parallel merge loop. Tests were added for each path, theLoaderHooksinterface now documents theOnLoad/OnFinishedcontract, and an integration test verifies the skip behaviour end-to-end.Checklist