Closed baryosef-loops closed 3 weeks ago
Thanks for report. I'll check it out.
I've just released new version 4.1.4 which should address this issue. https://www.npmjs.com/package/@eneris/push-receiver/v/4.1.4 Can you please verify?
@Eneris thank you, I will test during this week. What is the eventual solution? Can I add 'error' listeners? Will they be logged to console? Or else?
@Eneris thank you, I will test during this week. What is the eventual solution? Can I add 'error' listeners? Will they be logged to console? Or else?
I have added custom EventEmitter wrapper that wraps any listeners in try..catch and prints the error with console.error
. I may add an error
event later but that could possibly end up with circular deadlocks if used inproperly
Ok since there is no response, I take this as resolved
Encountered an issue where any uncaught errors thrown within the onNotification event handler cause the push notification receiver to become unresponsive to new notifications. This behavior seems to stem from errors not being properly caught and handled within the EventEmitter used as super (parent class).
As a result, the instance becomes stale silently, without any notice or debugged information, and no further push notifications will be handled by that same instance, effectively causing the receiver to "freeze" and ignore any subsequent notifications.
Steps to Reproduce:
});
pushReceiver.onNotification(() => { try { throw new Error("Test error"); } catch { ... } });