Skip to content

Commit 5d5f263

Browse files
committed
added PromiseWithoutRejectedCallbackFail
I added a function that demonstrates issue parse-community#456. I'm finding that if I don't specify a rejected callback for the Parse.Config.get() promise's Then method, it never reaches my When method and the function times out. I found this worked in hosted parse but not in the open source version. parse-community#456
1 parent 57e94dc commit 5d5f263

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/cloud/main.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,20 @@ Parse.Cloud.define('requiredParameterCheck', function(req, res) {
102102
}, function(params) {
103103
return params.name;
104104
});
105+
106+
Parse.Cloud.define("PromiseWithoutRejectedCallbackFail", function(request, response) {
107+
var promises = [];
108+
var result = {};
109+
110+
// fetch config
111+
result.config = {};
112+
113+
promises.push(Parse.Config.get().then(function(config) {
114+
result.config = config.attributes;
115+
}));
116+
117+
// wait for all promises to finish
118+
Parse.Promise.when(promises).then(function() {
119+
response.success(result);
120+
});
121+
});

0 commit comments

Comments
 (0)