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

Refactor ObservableQuery#getCurrentResult to reenable immediate delivery of warm cache results. #6710

Merged
merged 16 commits into from
Jul 27, 2020

Commits on Jul 27, 2020

  1. Configuration menu
    Copy the full SHA
    513d733 View commit details
    Browse the repository at this point in the history
  2. Stop using getCurrentQueryResult in updateQuery.

    Reducing the number of calls to getCurrentQueryResult from two to one will
    make it easier to collapse getCurrentQueryResult into getCurrentResult.
    benjamn committed Jul 27, 2020
    Configuration menu
    Copy the full SHA
    01a899e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c08043c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2192f89 View commit details
    Browse the repository at this point in the history
  5. Bring back QueryInfo#getDiff, and privatize updateWatch.

    Managing cache watching is now the exclusive responsibility of the
    QueryInfo class.
    benjamn committed Jul 27, 2020
    Configuration menu
    Copy the full SHA
    383405e View commit details
    Browse the repository at this point in the history
  6. Avoid watching cache for no-cache queries.

    Since no-cache queries never read from the cache, there's no point in
    making them watch the cache for changes, because the cache doesn't know
    anything about which fields were used by the no-cache query.
    benjamn committed Jul 27, 2020
    Configuration menu
    Copy the full SHA
    022c797 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    af2d1e3 View commit details
    Browse the repository at this point in the history
  8. Pass QueryInfo into ObservableQuery constructor.

    This gives the ObservableQuery direct access to its corresponding
    QueryInfo object, so the ObservableQuery doesn't have to keep asking the
    QueryManager for the QueryInfo corresponding to this.queryId.
    
    Important invariants: given ObservableQuery oq and QueryManager qm, it
    should always be the case that qm.queries.get(oq.queryId) ===
    oq.queryInfo, and oq.queryInfo.observableQuery === oq.
    benjamn committed Jul 27, 2020
    Configuration menu
    Copy the full SHA
    a1cd4f4 View commit details
    Browse the repository at this point in the history
  9. Avoid unnecessarily discarding QueryInfo fields on stop.

    Since ObservableQuery objects have a direct reference to their QueryInfo
    objects, it's possible for an ObservableQuery to find use for these fields
    even after the QueryManager has stopped the query and removed the
    QueryInfo object from queryManager.queries.
    benjamn committed Jul 27, 2020
    Configuration menu
    Copy the full SHA
    06a1dc2 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    0cf0cbd View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    61e0e62 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    7df6ec0 View commit details
    Browse the repository at this point in the history
  13. Move cache-first fallback logic after first network request.

    PR #6353 explains the rationale for switching to a cache-first FetchPolicy
    after an initial cache-and-network or network-only policy.
    
    When #6365 was implemented, options.fetchPolicy was examined only once, at
    the beginning of fetchQueryObservable, so the timing of changing
    options.fetchPolicy did not matter as much. However, fixing #6659 involves
    checking the current options.fetchPolicy whenever the QueryData class
    calls this.currentObservable.getCurrentResult(), so it's now more
    important to delay changing options.fetchPolicy until after the first
    network request has completed.
    benjamn committed Jul 27, 2020
    Configuration menu
    Copy the full SHA
    8be3800 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    5fe8fee View commit details
    Browse the repository at this point in the history
  15. Mention PR #6710 in CHANGELOG.md.

    benjamn committed Jul 27, 2020
    Configuration menu
    Copy the full SHA
    fb3c913 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    fd94a3d View commit details
    Browse the repository at this point in the history