调用breeze.saveChanges永远不会成功回调,但服务器上的数据会更新

时间:2014-08-21 20:51:00

标签: angularjs breeze azure-mobile-services ionic-framework

我正在使用breezejs来帮助管理我的数据。当我有更改并需要保存它们时,我在我的datacontext中调用breeze.saveChanges,永远不会调用saveSucceedded回调。我得到一个错误RangeError:超出了最大调用堆栈大小。但是保存是成功的,因为更改是在服务器上保留的。调用saveFailed但是在此之前调用了相同的错误。 callstack指向微风,但是由于微风数据正在保存,错误可能来自其他地方吗?

        function save(){
        return manager.saveChanges()
            .then(saveSucceedded)
            .catch(saveFailed)
            .finally(final);

        function saveSucceedded(result){
            console.log('Saved Data')// never gets here but data on server updates
        }
        function saveFailed(error){
            var msg = config.appErrorPrefix + 'Save failed: ' +
                breeze.saveErrorMessageService.getErrorMessage(error);
            error.message = msg;
            console.log(msg);
            throw  error;
        }
        function final(){
            console.log('finally')
        }
    }


RangeError: Maximum call stack size exceeded
    at http://localhost:3030/vendor/breezejs/breeze.debug.js:14571:13
    at __objectForEach (http://localhost:3030/vendor/breezejs/breeze.debug.js:47:13)
    at processAnonType (http://localhost:3030/vendor/breezejs/breeze.debug.js:14569:9)
    at processMeta (http://localhost:3030/vendor/breezejs/breeze.debug.js:14532:24)
    at visitNode (http://localhost:3030/vendor/breezejs/breeze.debug.js:14595:27)
    at http://localhost:3030/vendor/breezejs/breeze.debug.js:14572:13
    at __objectForEach (http://localhost:3030/vendor/breezejs/breeze.debug.js:47:13)
    at processAnonType (http://localhost:3030/vendor/breezejs/breeze.debug.js:14569:9)
    at processMeta (http://localhost:3030/vendor/breezejs/breeze.debug.js:14532:24)
    at visitNode (http://localhost:3030/vendor/breezejs/breeze.debug.js:14595:27) ionic.bundle.js:18897
[IMA Error] Save failed: Maximum call stack size exceeded datacontext.js:128
Error: [IMA Error] Save failed: Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
    at http://localhost:3030/vendor/breezejs/breeze.debug.js:14571:13
    at __objectForEach (http://localhost:3030/vendor/breezejs/breeze.debug.js:47:13)
    at processAnonType (http://localhost:3030/vendor/breezejs/breeze.debug.js:14569:9)
    at processMeta (http://localhost:3030/vendor/breezejs/breeze.debug.js:14532:24)
    at visitNode (http://localhost:3030/vendor/breezejs/breeze.debug.js:14595:27)
    at http://localhost:3030/vendor/breezejs/breeze.debug.js:14572:13
    at __objectForEach (http://localhost:3030/vendor/breezejs/breeze.debug.js:47:13)
    at processAnonType (http://localhost:3030/vendor/breezejs/breeze.debug.js:14569:9)
    at processMeta (http://localhost:3030/vendor/breezejs/breeze.debug.js:14532:24)
    at visitNode (http://localhost:3030/vendor/breezejs/breeze.debug.js:14595:27) 

0 个答案:

没有答案