-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Show a message if cloud functions are duplicated #6963
Show a message if cloud functions are duplicated #6963
Conversation
Danger run resulted in 1 fail and 1 markdown; to find out more, see the checks page. Generated by 🚫 dangerJS |
Codecov Report
@@ Coverage Diff @@
## master #6963 +/- ##
==========================================
+ Coverage 93.78% 93.81% +0.02%
==========================================
Files 169 169
Lines 12269 12271 +2
==========================================
+ Hits 11507 11512 +5
+ Misses 762 759 -3
Continue to review full report at Codecov.
|
Nice! Thanks for tackling this one. Could you please add a test case? |
How's that @davimacedo? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job! Simple and clean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
My last PR, this is a little QOL improvement.
Basically, if you create two cloud functions with the same name, the first will be ignored, which is expected behaviour, but can lead to headaches if your main.js is large and you accidentally name a function the same, or you redefine a cloud trigger.
E.g, you create an important validation trigger
And then further on, you think of adding another feature, but forget that you've already written a before save block,
All the validation from the first trigger won't run (which is fine), but it'll be hard to initially know why the code broke.
This just adds a simple
console.log
on server start, if there are duplicate cloud functions, so developers can understand more what's happening:Warning: Duplicate cloud functions exist for trigger beforeSave on class TestObject. The first will be ignored.