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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Bug Report: Disallow Empty Inputs in Template Function Variables #6313

Open
2 tasks done
ItzNotABug opened this issue Sep 23, 2023 · 3 comments
Open
2 tasks done
Assignees
Labels
bug Something isn't working product / functions Fixes and upgrades for the Appwrite Functions.

Comments

@ItzNotABug
Copy link
Contributor

馃憻 Reproduction steps

  1. Open any Function template that has required variables field.
  2. Use a space & click Next, the current step is marked complete.

Maybe implement a trim logic.

Tested on -

  • Payments with Stripe
  • Subscriptions with Stripe
  • Email contact form
  • GitHub issue bot
  • URL shortener - Allows spaces in url field
  • Sync with Algolia
  • Sync with Meilisearch
  • WhatsApp with Vonage
  • Push notification with FCM
  • Censor with Redact
  • Analyze with PerspectiveAPI
  • Discord Command Bot
  • Prompt ChatGPT
  • Starter function - Allows spaces in api key field

馃憤 Expected behavior

Show an error!

馃憥 Actual Behavior

Accepts the empty values.

馃幉 Appwrite version

Appwrite Cloud

馃捇 Operating system

Linux

馃П Your Environment

No response

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

  • I checked and didn't find similar issue

馃彚 Have you read the Code of Conduct?

@ItzNotABug ItzNotABug added the bug Something isn't working label Sep 23, 2023
@eldadfux eldadfux added the product / functions Fixes and upgrades for the Appwrite Functions. label Sep 23, 2023
@eldadfux
Copy link
Member

Thanks, I'll make sure one of our functions engineers will take a look at this.

@Meldiron
Copy link
Contributor

Hello there 馃憢
Thanks for raising the issue. I can see how this can affect developer experience, but I would like to raise a concern regarding some use cases.

For example there can be function to exportDatabase which would export all documents to CSV file. This function could accept required env variable CSV_SEPARATOR which could be (space), , or .. All I believe are reasonable separators.

With that in mind, space could be considered valid value for required parameter.

@ItzNotABug
Copy link
Contributor Author

@Meldiron Thanks for highlighting the CSV_SEPARATOR scenario.
I agree that spaces can be valid in certain contexts, they can also introduce ambiguity in others like URLs, API KEYS, File Paths etc.

Suggestions:

  1. Maybe disallow spaces as valid inputs across the function variables' input to prevent unintentional mistakes.
    For fields like CSV_SEPARATOR, allow only specific characters like . and , as valid inputs.
  2. Far fetched, display a hint confirming if the User did use a space manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product / functions Fixes and upgrades for the Appwrite Functions.
Projects
None yet
Development

No branches or pull requests

3 participants