-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
feat: Parallel include pointers #9861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Moumouls
wants to merge
11
commits into
parse-community:alpha
Choose a base branch
from
Moumouls:moumouls/concurrent-include
base: alpha
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+173
−20
Open
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
daaeed8
fix: mongodb-runner usage and default version to 6.0.2
Moumouls 5811465
fix: json
Moumouls 6e89fd1
feat: parallel include
Moumouls 28ffcd7
Merge branch 'alpha' of github.com:parse-community/parse-server into …
Moumouls 328a4be
Merge branch 'alpha' of github.com:parse-community/parse-server into …
Moumouls 8b99dc5
feat: add test to battle test include
Moumouls d854752
Merge branch 'alpha' into moumouls/concurrent-include
Moumouls c613e3f
Merge branch 'alpha' into moumouls/concurrent-include
mtrezza af50fd3
Merge branch 'alpha' into moumouls/concurrent-include
mtrezza 87339eb
add perf test
mtrezza 2618e96
Merge branch 'alpha' into moumouls/concurrent-include
mtrezza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hydration must not depend solely on
objectId.indexedResultscollapses every row whoseobjectIdis missing (e.g. aggregate pipelines that$projectout_idwhile keeping pointer fields) into the singleundefinedbucket. In that case only the last element inthis.response.resultsis updated and the remaining rows keep their raw pointers, whereas the previous sequential implementation handled these projections correctly. That’s a correctness regression.Please rework the assignment so we still hydrate by index whenever we cannot resolve an
objectId, e.g. by falling back to the loop index.🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
objectId is always present in parse returned include, does the issue still exists ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Length of output: 717
🏁 Script executed:
Length of output: 3354
🏁 Script executed:
Length of output: 4131
🏁 Script executed:
Length of output: 9784
@Moumouls, You're right that in normal query results,
objectIdis always present. However, I found an edge case where it can be missing:The edge case: When a RestQuery has both:
pipelineoption with$project: { _id: 0 }(explicitly excluding objectId)includeoptionLooking at the code:
pipeline(line 215) andinclude(line 236) without validation preventing their combinationhandleInclude()does NOT skip aggregate queries (unlikerunAfterFindTrigger()which checks forpipeline/distinctat line 927)$project: { _id: 0 }to exclude objectId (e.g.,spec/ParseQuery.Aggregate.spec.js:362-363)While this is admittedly a rare/unusual scenario (combining includes with aggregates that exclude
_id), the original concern is technically valid.Recommendation: Either add a guard to skip
handleInclude()whenpipelineordistinctis present (similar torunAfterFindTrigger), or implement the fallback indexing logic suggested in the original comment to handle this edge case safely.What do you think? Should we add protection against this edge case or is it acceptable to document that includes aren't supported with aggregate queries?
🧠 Learnings used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mtrezza from you knowledge is it normal to allow _id: 0 on projections ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.