Skip to content

Conversation

@samtstern
Copy link
Contributor

Description

Fixes #2533

Scenarios Tested

  1. Create a function exports.firestoreFn = functions.firestore.document('/test/{doc}').onWrite(...)
  2. Write a doc in /test the emulator UI, see that the function executes
  3. Change the trigger to be functions.firestore.document('/test2/{doc}')
  4. Write a doc in /test, nothing happens.
  5. Write a doc in /test2, see exactly one execution.

Logs:

$ firebase --project=demo-project-12345  emulators:start
i  emulators: Starting emulators: functions, firestore
i  emulators: Detected demo project ID "demo-project-12345", emulated services will use a demo configuration and attempts to access non-emulated services for this project will fail.
i  firestore: Firestore Emulator logging to firestore-debug.log
i  ui: Emulator UI logging to ui-debug.log
i  functions: Watching "/private/var/folders/xl/6lkrzp7j07581mw8_4dlt3b000643s/T/tmp.bH599aKP/functions" for Cloud Functions...
✔  functions[us-central1-firestoreFn]: firestore function initialized.

┌─────────────────────────────────────────────────────────────┐
│ ✔  All emulators ready! It is now safe to connect your app. │
│ i  View Emulator UI at http://localhost:4000                │
└─────────────────────────────────────────────────────────────┘

┌───────────┬────────────────┬─────────────────────────────────┐
│ Emulator  │ Host:Port      │ View in Emulator UI             │
├───────────┼────────────────┼─────────────────────────────────┤
│ Functions │ localhost:5001 │ http://localhost:4000/functions │
├───────────┼────────────────┼─────────────────────────────────┤
│ Firestore │ localhost:8080 │ http://localhost:4000/firestore │
└───────────┴────────────────┴─────────────────────────────────┘
  Emulator Hub running at localhost:4400
  Other reserved ports: 4500

Issues? Report them at https://github.com/firebase/firebase-tools/issues and attach the *-debug.log files.
 
i  functions: Beginning execution of "us-central1-firestoreFn"
>  test/qJN4KLuFOJItu0iIUjcK
i  functions: Finished "us-central1-firestoreFn" in ~1s
✔  functions[us-central1-firestoreFn]: firestore function initialized.
i  functions: Beginning execution of "us-central1-firestoreFn"
>  test2/6FyUaaYWMaILYtXwb3vK
i  functions: Finished "us-central1-firestoreFn" in ~1s

Sample Commands

N/A

@samtstern samtstern requested a review from yuchenshi July 7, 2021 14:30
@google-cla google-cla bot added the cla: yes Manual indication that this has passed CLA. label Jul 7, 2021
Copy link
Member

@yuchenshi yuchenshi left a comment

Choose a reason for hiding this comment

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

Any chance we can get an e2e test?

@samtstern
Copy link
Contributor Author

@yuchenshi getting a meaningful and reliable e2e test would not be possible in our current test setup because it would require modifying functions source files to hit the file watcher.

@yuchenshi
Copy link
Member

yuchenshi commented Jul 7, 2021

All right, let's go for it without automated tests then.

@samtstern samtstern merged commit 3fef751 into master Jul 8, 2021
devpeerapong pushed a commit to devpeerapong/firebase-tools that referenced this pull request Dec 14, 2021
@bkendall bkendall deleted the ss-fix-2533 branch March 18, 2022 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Manual indication that this has passed CLA.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected onCreate behavior after changing collection path and hot reload

2 participants