Skip to content

Debug Mode logs unnecessary errors

Created by: MarciiTheDev

When using v1.1.3-dev of the NodeJS MarcSync Client & the signalR.LogLevel in SubscriptionManager.ts at line 24 is set to signalR.LogLevel.Debug instead of signalR.LogLevel.None, it logs the following error everytime I update an entry.

Error: A callback for the method 'entryupdated' threw error 'TypeError: Cannot read properties of undefined (reading 'forEach')'.

This happens everytime I update an entry in my Collection. However, same counts for others when there are no subscribers on that subscription. The error tells us that it tries to look for subscribers in an array called: this._subscriptions, defined in the SubscriptionManager.ts script, by doing this._subscriptions.entryUpdated.forEach(). However, this._subscriptions.entryUpdated is undefined till a script subscribes to the entryUpdated subscription.

Same error applies to all other subscriptions when they are not initialized.