firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

Disabling background function triggers no longer has an effect in 11.10.0

Open briankintz opened this issue 2 years ago • 1 comments

[REQUIRED] Environment info

firebase-tools: 11.10.0

Platform: Ubuntu in WSL2

[REQUIRED] Test case

Firestore triggered function deployed to emulator.

[REQUIRED] Steps to reproduce

  1. Disable background functions via curl -X PUT localhost:4400/functions/disableBackgroundTriggers
  2. Make change in Firestore emulator that would trigger the function

[REQUIRED] Expected behavior

Function shouldn't be triggered.

[REQUIRED] Actual behavior

The emulator output shows that the function was disabled, but the change triggers it anyway.

Downgrading to 11.9.0 fixes the problem.

briankintz avatar Sep 27 '22 13:09 briankintz

Hi, on my side the disabling is work, but when I re-enable, the functions don't trigger any more. Neither 11.10 nor 11.11 nor 11.12 fix this issue.

This is rather annoying, as I do use it in my dev data generation / unit test script to disable the trigger before wiping previous emulator data, then re-enabling the trigger before running the scripts.

The obvious suspect would be: #4886

gpfister avatar Sep 30 '22 08:09 gpfister

I have same issue.

I have this following code in my mocha test

before(async () => { try { const response = await axios.put('http://localhost:4400/functions/disableBackgroundTriggers') console.log('Background triggers disabled') } catch (error) { console.log('ERROR') console.log(error) } })

The triggers will be exectued anyways AFTER the test is completed.

Downgrading to 11.9.0 works.

astyltsvig avatar Oct 26 '22 16:10 astyltsvig

The fix for the issue will be out in the next release of firebase cli. I'll try to have the team push for a release tomorrow.

Thank you all for your patience!

taeold avatar Nov 16 '22 21:11 taeold

@taeold

Unfortunately as per version 11.16.1 - the error is still there.

astyltsvig avatar Nov 25 '22 12:11 astyltsvig

Hopefully you have an update @taeold ! 😅🙏

I've tested versions from 11.10.0 to 11.19.0, and disabling + enabling function triggers remains broken in all versions. After a certain number of tests (in our case 4), HTTP triggered cloud functions simply never respond (nor are any debug logs produced in emulator output). We use the firebase emulator to drive our end-to-end test suite. In between each test, we disable function triggers, reset the database, and then re-enable function triggers. We're stuck on v11.9.0 because of this.

brandonpearcy avatar Jan 06 '23 04:01 brandonpearcy

@brandonpearcy Since 11.19.0 this issue has disappeared for me. I use the emulator in a similar fashion (for e2e testing), with functions that triggers on Auth, Firestore and Storage events (not on extensions).

Also with 11.19.0 I have moved to Node 18 (not that it should matter, but it might).

However, I don't clean between each e2e test (I have organised them so that they run one after each other in a consistent way), only at the beginning to start on a fresh Firestore, Auth and Storage. I do run the complete test multiple times (for example when I update one of the test script for a new scenario or to highlight a particular issue) and it works fine, I can clean properly, deactivating all triggers first, then activating again.

Quick edit: tested with 11.20.0 this morning and it is working like a charm, as described above.

gpfister avatar Jan 06 '23 09:01 gpfister