Skip to content Skip to sidebar Skip to footer

Firebase Transaction On Lower Node - Maximum Call Stack Size Exceeded

after several Q&A about the transaction mechanism I'm trying to run a transaction on a lowel node here is my data: activeOffers -LKohyZ58cnzn0vCnt9p details

Solution 1:

And finally it appeared to be very very stupid of me. If I wanted to use transaction returning a promise I should put

  .then((success)=>{   ...   }

after the transaction. i.e.:

return entryRef.transaction((current)=>{
    if (current) {
        if (current.details.seatsCount >= data.details.seatsCount) {
            current.details.seatsCount -= data.details.seatsCount;
        }
    }
    return current;
})
.then((success)=> {
.......
});

And everything is fine now :)

Post a Comment for "Firebase Transaction On Lower Node - Maximum Call Stack Size Exceeded"