jensrossbach / node-red-contrib-chronos

Time-based Node-RED scheduling, repeating, queueing, routing, filtering and manipulating nodes
https://jensrossbach.github.io/node-red-contrib-chronos
MIT License
28 stars 1 forks source link

Deprecated API warning: Calls to RED.util.evaluateJSONataExpression must include a callback #116

Closed zachowj closed 9 months ago

zachowj commented 1 year ago

Describe the bug

nodered  | 3 Oct 18:05:52 - [warn] Deprecated API warning: Calls to RED.util.evaluateJSONataExpression must include a callback. This will not be optional in Node-RED 4.0. Please identify the node from the following stack and check for an update on npm. If none is available, please notify the node author.
nodered  | 3 Oct 18:05:52 - [warn] Error
nodered  |     at Object.evaluateJSONataExpression (/usr/src/node-red/node_modules/@node-red/util/lib/util.js:775:18)
nodered  |     at getJSONataValue (/data/node_modules/node-red-contrib-chronos/nodes/scheduler.js:761:33)
nodered  |     at Timeout.handleTimeout [as _onTimeout] (/data/node_modules/node-red-contrib-chronos/nodes/scheduler.js:707:37)
nodered  |     at listOnTimeout (node:internal/timers:571:11)
nodered  |     at process.processTimers (node:internal/timers:512:7)

To reproduce Steps to reproduce the behavior:

  1. Drop in a scheduler node
  2. Change the schedule output to use JSONata

Expected behavior

No warning about deprecated API

Screenshots

image

Context information Please complete the following information.

Additional information

jensrossbach commented 1 year ago

This may take a while, it's not an easy fix as the behavior is changed fudamentally (from synchronous to asynchronous).

jensrossbach commented 9 months ago

Small intermediate feedback: the implementation is already done but I also need to adapt the unit tests which is a huuuge amount of work as a lot of them have to be rewritten due to the change from synchronous to asynchronous behavior. So this will still take a lot of time (and I cannot spend much time on this project at the moment unfortunately as I'm busy with other stuff).

In case I won't be able to finish adaptation of the unit tests before Node-RED 4.x will be released, I will publish the changes anyway. But until then, I won't release the changes before the unit tests are working again.

mickym2 commented 9 months ago

So I noticed the same error - and have detected these nodes recently. - So let me say you many thanks to your idea for these nodes and your work you have done until now. I will replace most of my other scheduling nodes, where I used no JSONATA. But with JSONATA this error floods the debug window. Thanks for your effort up to now!

jensrossbach commented 9 months ago

Thank you @mickym2! If the error messages are really flooding the logs, I will check if I can maybe release a beta version. I'm not sure if NPM/Node-RED supports pre-releases but let's see.

mickym2 commented 9 months ago

This is not so important, as the logs are OK, if you don't use JSONATA output. In case JSONATA is needed - I just added a change node after the scheduler node as a workaround. So no problem anymore at the moment.

jensrossbach commented 9 months ago

Meanwhile I decided to publish the fix already as I cannot predict when I will be finished with unit test adaptations. I disabled unit tests in the QA workflow for the time being and will update them in background.

So this issue is fixed with release 1.19.1.