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

feat(firestore): support waitForPendingWrites() API #4176

Merged
merged 10 commits into from
Aug 30, 2020
Merged

feat(firestore): support waitForPendingWrites() API #4176

merged 10 commits into from
Aug 30, 2020

Conversation

markterm
Copy link
Contributor

@markterm markterm commented Aug 30, 2020

Description

Support waitForPendingWrites() API

Release Summary

  • Supports waitForPendingWrites() API

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan


Think react-native-firebase is great? Please consider supporting the project with any of the below:

@CLAassistant
Copy link

CLAassistant commented Aug 30, 2020

CLA assistant check
All committers have signed the CLA.

@vercel
Copy link

vercel bot commented Aug 30, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/invertase/react-native-firebase/h5qee7crb
✅ Preview: https://react-native-fireba-git-fork-mark9white-wait-for-pending-6493b6.invertase.vercel.app

Copy link
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

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

This is excellent, thank you!

One quick question in the code about cancellation vs error

Then in general:
Checking upstream docs,

I think both of those are old enough there is no problem and this is correctly tagged as feature release not breaking - I'll work through that

packages/firestore/lib/index.d.ts Outdated Show resolved Hide resolved
@mikehardy mikehardy added Workflow: Needs Review Pending feedback or review from a maintainer. Workflow: Waiting for User Response Blocked waiting for user response. plugin: firestore Firebase Cloud Firestore Type: In Progress type: enhancement Implements a new Feature labels Aug 30, 2020
@mikehardy

This comment has been minimized.

@vercel vercel bot temporarily deployed to Preview August 30, 2020 16:13 Inactive
@markterm
Copy link
Contributor Author

I've run prettier on the e2e file, hopefully it will pass now.

mikehardy
mikehardy previously approved these changes Aug 30, 2020
@mikehardy mikehardy added Workflow: Pending Merge Waiting on CI or similar and removed Workflow: Waiting for User Response Blocked waiting for user response. labels Aug 30, 2020
@markterm
Copy link
Contributor Author

markterm commented Aug 30, 2020 via email

@mikehardy
Copy link
Collaborator

dependency analysis completed - there was already a breaking change that bumped the upstream sdk dependencies past the ones needed here: #3613

I will note in the release notes that this requires firebase-android-sdk bill of materials >= 22.2.0 and firebase-ios-sdk pod >= 6.8.0 for the avoidance of doubt, but it does not need a semver major

However, the e2e test is failing in CI for some reason, both android and ios look like this for the failure 🤔


2020-08-30T16:34:08.6881370Z       ✓ should clear any cached data
2020-08-30T16:34:08.6983380Z     wait for pending writes
2020-08-30T16:34:08.8802840Z detox[2930] INFO:  at e2e/init.js:38:15 
2020-08-30T16:34:08.8803100Z  
2020-08-30T16:34:08.8809410Z detox[2930] WARN:  at e2e/init.js:39:15 
2020-08-30T16:34:08.8810820Z  ⚠️ A test failed:
2020-08-30T16:34:08.8815830Z detox[2930] WARN:  at e2e/init.js:40:15 
2020-08-30T16:34:08.8816610Z  ️   ->  waits for pending writes
2020-08-30T16:34:08.8822210Z detox[2930] WARN:  at e2e/init.js:47:13 
2020-08-30T16:34:08.8822930Z  ️   ->  Retrying in 1 seconds ... (1)
2020-08-30T16:34:14.6718820Z detox[2930] WARN:  at e2e/init.js:44:15 
2020-08-30T16:34:14.6729010Z     🔴  Retry #1 failed...
2020-08-30T16:34:14.6747740Z detox[2930] WARN:  at e2e/init.js:47:13 
2020-08-30T16:34:14.6748870Z  ️   ->  Retrying in 2 seconds ... (2)
2020-08-30T16:34:25.2291000Z detox[2930] WARN:  at e2e/init.js:44:15 
2020-08-30T16:34:25.2388080Z     🔴  Retry #2 failed...
2020-08-30T16:34:25.2389420Z detox[2930] WARN:  at e2e/init.js:47:13 
2020-08-30T16:34:25.2390920Z  ️   ->  Retrying in 3 seconds ... (3)
2020-08-30T16:34:40.8773050Z detox[2930] WARN:  at e2e/init.js:44:15 
2020-08-30T16:34:40.8774850Z     🔴  Retry #3 failed...
2020-08-30T16:34:40.8776370Z detox[2930] WARN:  at e2e/init.js:47:13 
2020-08-30T16:34:40.8779610Z  ️   ->  Retrying in 4 seconds ... (4)
2020-08-30T16:35:01.4722610Z detox[2930] WARN:  at e2e/init.js:44:15 
2020-08-30T16:35:01.4735540Z     🔴  Retry #4 failed...
2020-08-30T16:35:01.4745160Z detox[2930] WARN:  at e2e/init.js:47:13 
2020-08-30T16:35:01.4749140Z  ️   ->  Retrying in 5 seconds ... (5)
2020-08-30T16:35:27.3027950Z       1) waits for pending writes
2020-08-30T16:35:27.3041950Z 

@markterm
Copy link
Contributor Author

dependency analysis completed - there was already a breaking change that bumped the upstream sdk dependencies past the ones needed here: #3613

I will note in the release notes that this requires firebase-android-sdk bill of materials >= 22.2.0 and firebase-ios-sdk pod >= 6.8.0 for the avoidance of doubt, but it does not need a semver major

However, the e2e test is failing in CI for some reason, both android and ios look like this for the failure 🤔

Ouch ... I re-verified the iOS test locally and it is passing for me - I don't suppose there are any more verbose logs saying which line it failed on? Is it working for you?

@mikehardy
Copy link
Collaborator

Hmm

There are not more verbose logs unless you actually add them (temporarily) to spit out console.log etc during the test. The android emulator and ios simulator both generate artifacts (available middle-top-right of the workflow run) where you can see things spit out by the emulator or simulator but I will be very surprised if those contain the info that points to the problem - those are mostly used by me to diagnose (and fix) CI flakiness issues where the virtual devices are mis-behaving or having timing issues etc

I have not attempted to reproduce locally - I was hoping you'd see some obvious thinko on inspection and post a fix 😅 - if you don't see anything, I'd propose instrumenting heavily - every single statement get a console.log stating where you are during execution then hopefully we can pinpoint it after pushing that and letting the test run

This part may be frustrating

@mikehardy
Copy link
Collaborator

Unrelated flake on the Android E2E test but iOS still failed with that change 🤔


2020-08-30T19:01:25.1112720Z       ✓ should clear any cached data
2020-08-30T19:01:25.1119230Z     wait for pending writes
2020-08-30T19:01:27.7272490Z detox[7984] INFO:  at e2e/init.js:38:15 
2020-08-30T19:01:27.7320470Z  
2020-08-30T19:01:27.7333270Z detox[7984] WARN:  at e2e/init.js:39:15 
2020-08-30T19:01:27.7342540Z  ⚠️ A test failed:
2020-08-30T19:01:27.7343180Z detox[7984] WARN:  at e2e/init.js:40:15 
2020-08-30T19:01:27.7344070Z  ️   ->  waits for pending writes
2020-08-30T19:01:27.7344610Z detox[7984] WARN:  at e2e/init.js:47:13 
2020-08-30T19:01:27.7345440Z  ️   ->  Retrying in 1 seconds ... (1)
2020-08-30T19:01:35.2775680Z detox[7984] WARN:  at e2e/init.js:44:15 
2020-08-30T19:01:35.2776900Z     🔴  Retry #1 failed...
2020-08-30T19:01:35.2782890Z detox[7984] WARN:  at e2e/init.js:47:13 
2020-08-30T19:01:35.2783580Z  ️   ->  Retrying in 2 seconds ... (2)
2020-08-30T19:01:47.9053840Z detox[7984] WARN:  at e2e/init.js:44:15 
2020-08-30T19:01:47.9055750Z     🔴  Retry #2 failed...
2020-08-30T19:01:47.9062090Z detox[7984] WARN:  at e2e/init.js:47:13 
2020-08-30T19:01:47.9062820Z  ️   ->  Retrying in 3 seconds ... (3)
2020-08-30T19:02:05.4712790Z detox[7984] WARN:  at e2e/init.js:44:15 
2020-08-30T19:02:05.4715030Z     🔴  Retry #3 failed...
2020-08-30T19:02:05.4719140Z detox[7984] WARN:  at e2e/init.js:47:13 
2020-08-30T19:02:05.4719890Z  ️   ->  Retrying in 4 seconds ... (4)
2020-08-30T19:02:28.0216100Z detox[7984] WARN:  at e2e/init.js:44:15 
2020-08-30T19:02:28.0218600Z     🔴  Retry #4 failed...

Comment on lines +404 to +406
try {
await firebase.auth().signOut();
} catch (e) {}
Copy link
Collaborator

Choose a reason for hiding this comment

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

That seems like it was it!

@mikehardy
Copy link
Collaborator

Fully green in CI now, thanks for sticking with that! Terribly slow trial-and-error fix process when it's a CI only break...

Copy link
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

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

Looks good, has docs and a test, not a semver major so the PR title will generate the correct version bump and changelog entry -> done!

@mikehardy mikehardy merged commit 6a4b45e into invertase:master Aug 30, 2020
@mikehardy mikehardy removed Type: In Progress Workflow: Needs Review Pending feedback or review from a maintainer. Workflow: Pending Merge Waiting on CI or similar labels Aug 30, 2020
@mikehardy
Copy link
Collaborator

And it's live - thanks!

  • @react-native-firebase/firestore@7.7.0

androidIsForVivek pushed a commit to androidIsForVivek/react-native-firebase that referenced this pull request Aug 9, 2021
* Implement waitForPendingWrites
* Remove spurious extra typedoc doc open
* Added test
* Ran prettier and added test of rejection on user change
* Made documentation clearer

Note: This requires firebase-android-sdk bill of materials >= 22.2.0 and firebase-ios-sdk pod >= 6.8.0

Co-authored-by: Mike Hardy <github@mikehardy.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: firestore Firebase Cloud Firestore type: enhancement Implements a new Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants