Show a message if cloud functions are duplicated#6963
Merged
dplewis merged 4 commits intoparse-community:masterfrom Oct 23, 2020
Merged
Show a message if cloud functions are duplicated#6963dplewis merged 4 commits intoparse-community:masterfrom
dplewis merged 4 commits intoparse-community:masterfrom
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.
|
Member
|
Nice! Thanks for tackling this one. Could you please add a test case? |
Member
Author
|
How's that @davimacedo? |
davimacedo
requested changes
Oct 22, 2020
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.logon 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.