afterTransaction event handler error

Hi,
hope you are doing well!

I am trying to use afterTransaction event handler, but when I create it, even just empty it returns an error.
So what I am having after creation:

Backendless.ServerCode.Persistence.afterTransaction('*', async function(req, res) {
  //add your code here
  console.log("AFTER TRANSACTION!!!!");
});

And that is what I get in the log:

20:1:26.607 | SERVER_CODE | ERROR | [3474] TypeError: Cannot read property ‘value’ of undefined at /usr/local/lib/node_modules/backendless-coderunner/lib/util/json.js:191:51 at Array.forEach () at objectRefsReviver (/usr/local/lib/node_modules/backendless-coderunner/lib/util/json.js:190:14) at Object. (/usr/local/lib/node_modules/backendless-coderunner/lib/util/json.js:199:60) at JSON.parse () at Object.exports.parse (/usr/local/lib/node_modules/backendless-coderunner/lib/util/json.js:211:15) at Object.exports.decode (/usr/local/lib/node_modules/backendless-coderunner/lib/server-code/runners/tasks/util/args.js:22:12) at /usr/local/lib/node_modules/backendless-coderunner/lib/server-code/runners/tasks/invoke-handler.js:67:31 at new Promise () at execute (/usr/local/lib/node_modules/backendless-coderunner/lib/server-code/runners/tasks/invoke-handler.js:52:10)

How can I fix it?

Thanks a lot for your help,
best,
Nike.

Hello @nike-teo

Looking into it

1 Like

I just tried to reproduce the problem and seems like it works well for me, could you please provide more details:

  • your appId
  • how/where do run your transaction on the client

App ID: 6B6CD8C0-53B8-C5A1-FFC6-C2F9675E9100
I am using deep-save (/data/Property/deep-save), which counts as transaction, I believe. I also have beforeTransaction handler, which works fine, can this be an issue somehow?

I was able to reproduce the problem and created an internal ticket to fix that, the ticket’s number for reference is BKNDLSS-28673.
We notify you here once we released it on the prod.

1 Like

I am having exactly this problem for days now thinking it was something I was doing wrong :frowning:

Hope we can resolve soon…

1 Like

Hi Vladimir, hope you are doing well. Is there any estimations for the fix? It’s pretty much a blocker for me, so would like to know how to plan the work. Thanks!

Hello @nike-teo

I apologize for the long delay. We have already updated our cloud servers to resolve your problem. Are you still encountering an error?

Regards,
Inna

Works like a charm, thanks a lot!