-
Notifications
You must be signed in to change notification settings - Fork 447
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
partial request deduping #897
Conversation
dedupes 2 major cases: paths followed via refs in cache, and paths with ranges in the end remaining: paths with more properties after the range, and not followed via refs in client cache
about sending requests in order (cannot make them sequential, must be parallel)
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.
LGTM.
test/data/LocalDataSource.js
Outdated
if (wait > 0) { | ||
setTimeout(exec, wait); | ||
} else { | ||
if (wait === false) { |
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.
Agree with the decision to make "0" mean setTimeout(0). However would've used null/undefined to indicate no wait. That way the member could just be optional, and if not included, there would be no async.
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.
thanks! points from discussion with @jhusain :
it did already was no wait if you missed the property (because wait gets defaulted to false
earlier), but that did leave out the case where wait is explicitly sent in as undefined. agreed that missing the property should behave the same as setting it to undefined, so now:
using undefined
to indicate no wait. not caring about null
or other possible types at this point (this is test helper code).
update:
pull request is ready for review and merging! all edge cases covered.
update:
pull request is up for review now. all edge case bugs fixed. adding some tests now.
dedupes 2 major cases: paths followed via refs in cache, and paths with ranges in the end
pull request is still in progress, but still want to get opinion on the approach
work remaining: dedupe paths with more properties after the range, and not followed via refs in client cache (like
['videosById', { from: 0, to: 10 }, 'name' ]
wherevideosById
is not in cachefixes #779