Event handlers doesn't work

I had a problem with afterPush event, I wrote about in in this topic.

So I did simple test:

Steps to reproduce:

  1. Create simple handler:

Backendless.ServerCode.Persistence.afterUpdate(‘*’, function(req, res) {
Backendless.Logging.getLogger(“com.mbaas.Logger”).info(“After update executed”);
});

  1. Deploy it it prod.

  2. Create simple table “Test” with one field “value”.

  3. Insert record in “Test” table.

  4. Change “value” to “value1”, from “value1” to “value2”, from “value2” to “value3” by web-console.

  5. Open “REAL-TIME LOGGING”.

Expected result

After update executed string appears in REAL-TIME LOGGING

Actual result

Handler doesn’t work. I didn’t see After update executed string.

Sun Jul 12 2020 21:50:42 GMT+0300 (MSK) | SERVER_CODE | INFO | [15031] [ANALYSE CODE] codePath: /opt/backendless/repo/f20a5ddc-36f3-5efa-ff8e-c4ffcb5aa300/files/servercode/JS/default/DRAFT

Sun Jul 12 2020 21:50:42 GMT+0300 (MSK) | SERVER_CODE | INFO | [15031] Building Model…

Sun Jul 12 2020 21:50:42 GMT+0300 (MSK) | SERVER_CODE | INFO | [15031] ServerCode Model built in 63ms

Sun Jul 12 2020 21:50:42 GMT+0300 (MSK) | SERVER_CODE | INFO | [15031] Event handlers (1):

Sun Jul 12 2020 21:50:42 GMT+0300 (MSK) | SERVER_CODE | INFO | [15031] messaging.afterPublish (*) (handlers/messaging/generic/afterPublish.js)

Sun Jul 12 2020 21:50:42 GMT+0300 (MSK) | SERVER_CODE | INFO | [15031] Processing finished in 90.046ms

Application ID

F20A5DDC-36F3-5EFA-FF8E-C4FFCB5AA300

@Dmitry_Mirovodin Hello, I was not able to reproduce the issue:

Mon Jul 13 2020 12:23:53 GMT+0300 (Eastern European Summer Time) | SERVER_CODE | INFO | [31389] Building ServerCode Model for path (/opt/backendless/repo/f20a5ddc-36f3-5efa-ff8e-c4ffcb5aa300/files/servercode/JS/default/PRODUCTION)
Mon Jul 13 2020 12:23:53 GMT+0300 (Eastern European Summer Time) | SERVER_CODE | INFO | [31389] ServerCode Model built in 8ms
Mon Jul 13 2020 12:23:54 GMT+0300 (Eastern European Summer Time) | SERVER_CODE | INFO | [31389] [79c5e952-0726-4c07-92f1-4d3ecbaa5061] [INVOKE HANDLER] persistence.afterUpdate (*)
Mon Jul 13 2020 12:23:54 GMT+0300 (Eastern European Summer Time) | com.mbaas.Logger | INFO | After update executed
Mon Jul 13 2020 12:23:54 GMT+0300 (Eastern European Summer Time) | SERVER_CODE | INFO | [31389] Processing finished in 121.824ms

From your steps:

  1. Insert record in “Test” table.

but you should update record, not insert, because you create afterUpdate

Sergey, I’ve recorded video to explain:

I’ve updated record 4 times of more… but I’ve got any messages from log.

@Dmitry_Mirovodin data event handlers works only if you are using API, so to achieve the result with backendless console, update record using REST Console

ooo THANKS!