console icon indicating copy to clipboard operation
console copied to clipboard

🚀 Feature: Enable / Disable Functions from Console

Open ItzNotABug opened this issue 2 years ago • 3 comments

🔖 Feature description

This Server Side SDK for Functions has this param enabled on method functions.update(...) but the console does not have a UI component to toggle this behaviour.


On a side note, the docs say -

ENABLED boolean

Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.

This doesn't include info. if the Function will be triggered by Events or Cron or only by the Server Side SDKs with an API Key.

🎤 Pitch

As discussed about the usecase on Discord -

Usecase: A normal function is exposed to be used on production, receives events, requests and what not.

Now if you want to test another function that receives similar events, the one in production will be executed on test values / useless event data.

More discussion here.

👀 Have you spent some time to check if this issue has been raised before?

  • [X] I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

ItzNotABug avatar Oct 10 '23 18:10 ItzNotABug

@ItzNotABug thanks for raising this issue! 🙏🏼

Now if you want to test another function that receives similar events, the one in production will be executed on test values / useless event data.

To prevent a function from executing on an event, I would recommend removing the events from the function.

stnguyen90 avatar Oct 11 '23 00:10 stnguyen90

@stnguyen90 That'd work if there's like one or two event. Not feasible if there are multiple sets of event attached to a Function.

Also it'd be a hassle to note down the events before removing them, so that correct events can be re-added later.

ItzNotABug avatar Oct 11 '23 05:10 ItzNotABug

This already has API support. We just need to allow the option from the console.

eldadfux avatar Oct 24 '24 06:10 eldadfux