Skip to content

Add invokeRunQueryRpc() #3025

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

Merged
merged 2 commits into from
May 6, 2020
Merged

Add invokeRunQueryRpc() #3025

merged 2 commits into from
May 6, 2020

Conversation

schmidt-sebastian
Copy link
Contributor

This adds a new invokeRunQueryRpc RPC that is used (and tested) in the Lite SDK to run queries via Rest.

This is similar to

export async function invokeBatchGetDocumentsRpc(

Note:

@google-oss-bot
Copy link
Contributor

google-oss-bot commented May 5, 2020

Binary Size Report

Affected SDKs

  • @firebase/firestore

    Type Base (76ba2ea) Head (27f0a7c) Diff
    browser 248 kB 248 kB +38 B (+0.0%)
    esm2017 193 kB 193 kB +16 B (+0.0%)
    main 488 kB 488 kB +113 B (+0.0%)
    module 246 kB 246 kB +38 B (+0.0%)
  • @firebase/firestore/memory

    Type Base (76ba2ea) Head (27f0a7c) Diff
    browser 188 kB 188 kB +38 B (+0.0%)
    esm2017 148 kB 148 kB +16 B (+0.0%)
    main 365 kB 365 kB +113 B (+0.0%)
    module 187 kB 187 kB +38 B (+0.0%)
  • firebase

    Type Base (76ba2ea) Head (27f0a7c) Diff
    firebase-firestore.js 287 kB 287 kB +41 B (+0.0%)
    firebase-firestore.memory.js 228 kB 229 kB +41 B (+0.0%)
    firebase.js 820 kB 820 kB +41 B (+0.0%)

Test Logs


return (
response
// Filter RunQueryResponses that only contain readTimes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ultranit: consider s/Filter/Omit/ ("filter" has the unfortunate ambiguity in that it might refer to either the part that is left in place or the part that gets removed. It's clear enough from the context, but I still think something like "omit" is slightly better).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

structuredQuery
};

const response = await datastoreImpl.invokeStreamingRPC<
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: it appears that response is actually a container, perhaps rename it to responses, streamingResponse, etc.?


return (
response
// Filter RunQueryResponses that only contain readTimes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: from reading the PR description, it appears that only the last element may not contain a document, whereas the comment makes it seem as if there might be several such elements throughout the container.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description reflects the behavior that I have observed. The protocol state though that it is also valid to not provide a document mid-stream as a way to report status.

@schmidt-sebastian schmidt-sebastian merged commit 8877803 into master May 6, 2020
@firebase firebase locked and limited conversation to collaborators Jun 6, 2020
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/rungetquery branch November 9, 2020 22:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants