Move hydrate resolve model into a common place#1289
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Centralizes model hydration within the initial fetch loop instead of during subsequent resolution calls.
- Removes per-call hydration in resolution methods, relying on hydration performed when populating _familyMap.
- Adjusts loops to avoid redundant hydration and simplifies conditional checks for null or type mismatches.
Comment on lines
+266
to
+267
| for (let model of data) { | ||
| model = await this._hydrateResolvedModel(model); |
There was a problem hiding this comment.
[nitpick] Reassigning the loop variable inside a for-of (let model of data) obscures the distinction between the raw API response and the hydrated model. Prefer using a distinct variable (e.g. for (const rawModel of data) { const model = await this._hydrateResolvedModel(rawModel); ... }) to improve clarity and prevent accidental use of the unhydrated object.
Suggested change
| for (let model of data) { | |
| model = await this._hydrateResolvedModel(model); | |
| for (const rawModel of data) { | |
| const model = await this._hydrateResolvedModel(rawModel); |
TylerLeonhardt
approved these changes
Oct 10, 2025
lramos15
added a commit
that referenced
this pull request
Oct 13, 2025
dileepyavan
pushed a commit
that referenced
this pull request
Oct 14, 2025
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.
No description provided.