-
Notifications
You must be signed in to change notification settings - Fork 950
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
firestore:delete not working against emulator since version 12.6.2 / fails in 12.7+ #6537
Comments
This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information. |
They both appear like they are working based on debug logs, I just did the deletes against a trimmed down version of my data set (just domain data really, not our transaction data) and I observed the behavior I describe despite the debug logs both looking pretty similar to my untrained eye |
Hey @mikehardy, thanks for the detailed report, this is a lot of info! I was able to reproduce the behavior you described. As you mentioned, it does look like the issue started occurring on v12.7.0. Let me raise this to our engineering team so that they can take a look and investigate the issue. |
I spend most of my time in react-native-firebase trying to reproduce issues users send me, and then trying to fix them, so I'm very sympathetic to reproduction challenges and sensitive to not having enough info to reproduce. It's hard maintaining software! Glad you were able to see it with info provided, and I'll be happy to collaborate to get a fix going or verify one if needed. Cheers @aalej |
Just deleted my production users collection after running my local tests, 😢 . Changing from firebase-tools/src/gcp/firestore.ts Lines 1 to 9 in 916fc34
It appears that Lines 70 to 83 in 916fc34
I don't know why this choice was made though. So just letting info here in hopes that help the team to fix this issue. Edit: As a quick workaround setting the |
I am getting the same behavior in v13.0.2. Even though I have set
|
Taking @Pickachu suggestion, I was able to delete the data in the emulator by setting: |
Nice - confirmed for me that if I set FIRESTORE_URL in my script I successfully get collection deletion in my local emulator including an example in case it maybe helps someone // options parsing etc etc, determine my script should use emulator, set these things:
process.env.FIRESTORE_URL = "http://localhost:8080"; // that's new
process.env.FIRESTORE_EMULATOR_HOST = 'localhost:8080';
process.env.FIREBASE_AUTH_EMULATOR_HOST = 'localhost:9099';
process.env.GCLOUD_PROJECT = getFirebaseProjectName();
// ...do all your stuff, including maybe awaiting a call to this function and it'll work as child inherits parent env
function deleteAllFirestoreCollections() {
const child = spawnSync(
'yarn',
[
'firebase',
'firestore:delete',
'--all-collections',
'--project',
getFirebaseProjectName(),
'--account',
'[email protected]',
'--force',
],
{ shell: process.platform === 'win32' },
); |
Was confused 🤔 on this until I found this post. This is still an issue with 13.2.1, and as previously mentioned setting FIRESTORE_URL is the fix. I don't see FIRESTORE_URL documented anywhere in the official docs. Bad:
Good:
|
[REQUIRED] Environment info
firebase-tools: 12.9.1
Platform: any platform, mostly testing macOS
[REQUIRED] Test case
Note that this will work against firestore in the cloud if not careful please do not destroy data accidentally!
It does not delete data against the emulator but against the cloud it works just fine!
FIRESTORE_EMULATOR_HOST=localhost:8080 yarn firebase firestore:delete --all-collections --project <your project name> --account <your acct> --force
(or, at least I run it with yarn around it, but I'm sure you see how to run it - project name / account are whatever you need in your local env against your emulator)
[REQUIRED] Steps to reproduce
The test case above is it, if you call this using firebase-tools 12.6.2, all the collections will be removed. From 12.7.0 onwards the collections will not be removed.
The emulator server side seems version-insensitive, the behavior varies by version on the calling side
[REQUIRED] Expected behavior
All the collections should be removed, for a fresh data load (I test data loads + migrations...)
[REQUIRED] Actual behavior
The collections stay in place, no data is deleted.
I bisected the versions to see which version began failing because I knew it used to work, but it took me a while to find time to pinpoint this for this repo (I'm normally swamped, as the react-native-firebase maintainer 👋 😆 )
diff between 12.6.2 and 12.7.0 is the problem --> v12.6.2...v12.7.0
The text was updated successfully, but these errors were encountered: