Skip to content
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

Server side changes to support infinite scroll #795

Merged
merged 4 commits into from
Feb 17, 2021

Conversation

shankari
Copy link
Contributor

  • support querying by other time keys instead of only metadata.write_ts. This
    ensures that we can accurately query for analysed results as well, since they
    can be generated at any time after the raw data is collected.
  • support returning both the max and min value of any data field
    • Change the existing call to get_max_value_for_field to use it
    • Add a new method to the API that gets the pipeline range, not just the last entry
  • use this to figure out when to properly stop the infinite scroll

+ support querying by other time keys instead of only `metadata.write_ts`. This
ensures that we can accurately query for analysed results as well, since they
can be generated at any time after the raw data is collected.
+ support returning both the max and min value of any data field
    - Change the existing call to get_max_value_for_field to use it
    - Add a new method to the API that gets the pipeline range, not just the last entry
+ use this to figure out when to properly stop the infinite scroll
@shankari
Copy link
Contributor Author

This partially fixes e-mission/e-mission-docs#226
There is a phone PR that complements this that I will check in soon as well.

This allows us to not go into an infinite scroll in case the user doesn't have
any analysis results.

Without this fix, we returned (-1, -1), so the phone code assumed that was
valid and created the timestamp range by subtracting a week from it. So we kept
going into negative timestamp ranges and got into an infinite loop.

This returns None, so the `if (pipeline_range.end_ts)` check actually works
Which is now replaced by get_first_value_for_field(... pymongo.DESCENDING)
So we can check for 1c113c0
going forward
@shankari
Copy link
Contributor Author

Related phone changes are at:
e-mission/e-mission-phone#736

@shankari shankari merged commit b53f8df into e-mission:master Feb 17, 2021
@shankari shankari deleted the add_infinite_scroll branch February 17, 2021 21:40
@shankari shankari restored the add_infinite_scroll branch February 17, 2021 21:40
jf87 pushed a commit to jf87/e-mission-server that referenced this pull request Jun 21, 2021
Server side changes to support infinite scroll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant