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

Document Stream does not work (at least on emulator) (gRPC INVALID_ARGUMENT) #121

Open
penguisnt opened this issue Aug 10, 2023 · 1 comment

Comments

@penguisnt
Copy link

flutter: gRPC Error (code: 3, codeName: INVALID_ARGUMENT, message: Database name "projects/XXX/databases/(default)/documents" has extra characters at index XX., details: [], rawResponse: null, trailers: {})

The issue is because the 'database' name is set with the trailing '/documents' suffix, which is invalid.

firestore_gateway.dart setListenRequest( does this:

            options: CallOptions(
                metadata: {'google-cloud-resource-prefix': database}))

The database here should be the database itself, not the 'collections' path (which is just a document in firestore). Passing the database name without the trailing '/documents' fixes the issue.

Firestore gateway likely should not set the 'database' equal to the data+'/documents' path, like it is doing here:

        database =
            'projects/$projectId/databases/${databaseId ?? '(default)'}/documents',
@penguisnt
Copy link
Author

Here is the changes I made locally to fix the .stream issues, feel free to take as much of this as you want for yourself and merge it in, I unfortunately do not have the bandwidth for tests+pull request.

Note this also includes support for Firestore Auth emulator

https://github.com/penguisnt/firedart

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

No branches or pull requests

1 participant