Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Conversation

@KevinTheGray
Copy link
Contributor

Description

Currently the flutter implementation of Firestore generates a new document ID in the same way it is geenrated for the RTDB. However, this behavior has been modified for Firestore, and it no longer generates IDs in the same way. I was motivated to make this change because:

  1. The plugins should behave as close as possible to the native implementation. It was very obvious to me when I saw the keys that were being generated that they were not mimicking expected behavior.

  2. It's probably negligible, but the new code is a lot less complex and under less constraints.

Related Issues

flutter/flutter#15715

flutter/flutter#15715 is resolved because it now matches how the Android/iOS generate document IDs. That is, from the pool of characters from String "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", we choose 20 random ones and generate an ID.

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.
  • 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.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • 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?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

@kroikie
Copy link
Contributor

kroikie commented Jul 25, 2019

@KevinTheGray Thanks for this PR, looks good to me, once the tests pass I will merge.

Copy link
Contributor

@kroikie kroikie left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -1,3 +1,7 @@
## 0.12.8

* Updated how document Ids are generated to more closely match native implementations.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Updated how document Ids are generated to more closely match native implementations.
* Updated how document ids are generated to more closely match native implementations.

@collinjackson collinjackson merged commit 29f6ec4 into flutter:master Jul 26, 2019
mithun-mondal pushed a commit to bKash-developer/archived_plugins that referenced this pull request Aug 6, 2019
julianscheel pushed a commit to jusst-engineering/plugins that referenced this pull request Mar 11, 2020
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.

4 participants