You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
when i set persist to true orm-timestamp throws a "Maximum call stack size exceeded" error
Here is full stack trace and error:
(node:7632) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): RangeError: Maximum call stack size exceeded
(node:7632) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the
Node.js process with a non-zero exit code.
RangeError: Maximum call stack size exceeded
at Object.now (C:\actcustomer\node_modules\orm-timestamps\lib\orm-timestamps.js:7:16)
at Object.<anonymous> (C:\actcustomer\node_modules\orm-timestamps\lib\orm-timestamps.js:81:46)
at Object.exports.wait (C:\actcustomer\node_modules\orm\lib\Hook.js:19:26)
at saveInstanceProperty (C:\actcustomer\node_modules\orm\lib\Instance.js:422:10)
at Object.set [as modified_at] (C:\actcustomer\node_modules\orm\lib\Instance.js:521:11)
at Object.<anonymous> (C:\actcustomer\node_modules\orm-timestamps\lib\orm-timestamps.js:81:36)
at Object.exports.wait (C:\actcustomer\node_modules\orm\lib\Hook.js:19:26)
at saveInstanceProperty (C:\actcustomer\node_modules\orm\lib\Instance.js:422:10)
at Object.set [as modified_at] (C:\actcustomer\node_modules\orm\lib\Instance.js:521:11)
at Object.<anonymous> (C:\actcustomer\node_modules\orm-timestamps\lib\orm-timestamps.js:81:36)
at Object.exports.wait (C:\actcustomer\node_modules\orm\lib\Hook.js:19:26)
at saveInstanceProperty (C:\actcustomer\node_modules\orm\lib\Instance.js:422:10)
at Object.set [as modified_at] (C:\actcustomer\node_modules\orm\lib\Instance.js:521:11)
at Object.<anonymous> (C:\actcustomer\node_modules\orm-timestamps\lib\orm-timestamps.js:81:36)
at Object.exports.wait (C:\actcustomer\node_modules\orm\lib\Hook.js:19:26)
at saveInstanceProperty (C:\actcustomer\node_modules\orm\lib\Instance.js:422:10)
Maximum call stack size exceeded
The text was updated successfully, but these errors were encountered:
Hi @Eddie-CooRo, I'm afraid I haven't seen this before, however it looks like the issue stems from you having autoSave enabled on your object. This means that as soon as this plugin changes the modified_at field, orm's Instance attempts to save the new changes - this obviously continues ad-infinitum until you end up with a stack overflow.
I, unfortunately, can't see a way to make a plugin like this work with autoSave enabled so my advice is going to be to either disable autoSave and manually trigger saving of your instances (which is likely going to reduce the number of queries you make to the DB anyway) or manually manage the modified_at timestamp.
Hi
when i set persist to true orm-timestamp throws a "Maximum call stack size exceeded" error
Here is full stack trace and error:
The text was updated successfully, but these errors were encountered: