Skip to content

[cloud_firestore, cloud_firestore_web] Fix encoding issues in DocumentSnapshotPlatform and FieldValueFactoryWeb #2105

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 6 commits into from
Mar 6, 2020

Conversation

ditman
Copy link
Contributor

@ditman ditman commented Mar 2, 2020

Description

This change reproduces the issue reported in #2044 with an Integ test, and fixes it.

While running Integ tests, I discovered some extra changes required to get them all to pass (on Android, at least), and shaved that Yak.

This also fixes another encoding issue in _web that was recently introduced. Web still has one broken Integ test (re: encoding of Timestamp objects), that I'll attempt to fix next.

/cc @amrfarid140

Related Issues

Closes #2044.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • If the pull request affects only one plugin, the PR title starts with the name of the plugin in brackets (e.g. [cloud_firestore])
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • No, this is not a breaking change.

```
I/flutter ( 4164): 00:07 +9: Firestore pagination with DocumentReference (#2044) [E]
I/flutter ( 4164):   Invalid argument: Instance of 'DocumentReference'
I/flutter ( 4164):   package:flutter/src/services/message_codecs.dart 392:7                                                                                 StandardMessageCodec.writeValue
I/flutter ( 4164):   package:cloud_firestore_platform_interface/src/method_channel/utils/firestore_message_codec.dart 83:13                                 FirestoreMessageCodec.writeValue
I/flutter ( 4164):   package:flutter/src/services/message_codecs.dart 389:9                                                                                 StandardMessageCodec.writeValue.<fn>
I/flutter ( 4164):   dart:collection-patch/compact_hash.dart 379:8                                                                                          _LinkedHashMapMixin.forEach
I/flutter ( 4164):   package:flutter/src/services/message_codecs.dart 387:13                                                                                StandardMessageCodec.writeValue
I/flutter ( 4164):   package:cloud_firestore_platform_interface/src/method_channel/utils/firestore_message_codec.dart 83:13                                 FirestoreMessageCodec.writeValue
```
This is required for the arrayRemove/arrayUnion FieldValues.
Also tweak some integ tests so everything passes now, in Android.
@ditman ditman changed the title Issues/2044 [cloud_firestore, cloud_firestore_web] Fix encoding issues in DocumentSnapshotPlatform and FieldValueFactoryWeb Mar 2, 2020
@ditman
Copy link
Contributor Author

ditman commented Mar 2, 2020

This doesn't seem like a flake, but I don't know how to fix this :/ (the error seems to come from Firebase core?)

** BUILD FAILED **
The following build commands failed:
	CompileC /private/var/folders/3y/l0z1x3693dl_8n0qybp4dqwh0000gn/T/cirrus-ci-build/packages/cloud_firestore/cloud_firestore/example/build/macos/Build/Intermediates.noindex/Pods.build/Release/firebase_core.build/Objects-normal/x86_64/FLTFirebaseCorePlugin.o /Users/anka/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.4.4+2/darwin/Classes/FLTFirebaseCorePlugin.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler

@collinjackson
Copy link
Contributor

That mac failure seems to be affecting all builds right now. @franciscojma86 any ideas?

@franciscojma86
Copy link
Contributor

I just ran it locally and I'm getting UserAgent.h not found. #2099 should fix it when it lands?

@ditman
Copy link
Contributor Author

ditman commented Mar 3, 2020

@franciscojma86 #2099 is failing with the same error. Is this one of those cases where we need to merge in red to get the tree green again?

@franciscojma86
Copy link
Contributor

Not quite sure. I seems like @collinjackson still need to update the PR with Jenn's comments.

@collinjackson
Copy link
Contributor

I'll try to get to #2099 today. Thanks for your patience.

@ditman
Copy link
Contributor Author

ditman commented Mar 5, 2020

@collinjackson @franciscojma86 is it OK if I merge this with that check failing? Several other (seemingly unrelated) changes have been landed with that test in red.

@collinjackson
Copy link
Contributor

Yes, go ahead and land it, the tests are red on tip of tree so fixing so landing #2099 isn't going to improve the situation, it'll just unblock @franciscojma86 troubleshooting the failing mac test.

I think that what may have happened is that 7a312ce passed the tests but then broke the build shortly afterwards when it was published. Having a way of testing the effect of firebase_core changes on other plugins in this repo prior to publication would be helpful here.

We could roll back that PR to do so would effectively mean not having macos support and might do more harm than good.

@collinjackson
Copy link
Contributor

@franciscojma86 in the meantime you can try a clean checkout and build for mac and it should probably get you past the UserAgent.h issue.

@ditman
Copy link
Contributor Author

ditman commented Mar 6, 2020

We could roll back that PR to do so would effectively mean not having macos support and might do more harm than good.

@collinjackson I think we should try to fix ASAP and roll forward, if possible (but that's a discussion for another ticket PR/Issue)

@ditman
Copy link
Contributor Author

ditman commented Mar 6, 2020

I'm landing this with the build-apps+drive-examples check failing.

@ditman ditman merged commit 1d1d994 into firebase:master Mar 6, 2020
@ditman
Copy link
Contributor Author

ditman commented Mar 6, 2020

I'll wait for the post-submit to finish before publishing this two plugins.

@ditman ditman deleted the issues/2044 branch March 6, 2020 19:07
@ditman
Copy link
Contributor Author

ditman commented Mar 6, 2020

The post-submit is not worse than the previous one, so I'm publishing this two plugins now.

@ditman
Copy link
Contributor Author

ditman commented Mar 6, 2020

@firebase firebase locked and limited conversation to collaborators Aug 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[cloud_firestore] DocumentReference in startAfterDocument snapshot causes crash (invalid encode argument)
4 participants