Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
notification issues with latest release #1547
Describe the issue
I believe it is related to the change in commit: e2623d6 in PGStream in hasMessagePending()
It will add the first notification to the list to be returned, then since the nextStreamAvailableCheckTime gets set to 1s in the future in the prior call, the next call immediately after to get any remaining notifications returns false, even though there are notifications pending.
For example, with a loop calling getNotifications() every 100ms, it would return a single notification every 10 calls, and would take 30 seconds of wall-clock time, and 300 calls of getNotifications() to process the 30 notifications which were queued up.
Running a simple query (SELECT 1;) beforehand will allow all notifications to be received and processed by a single call to getNotifications().