webpush
webpush copied to clipboard
Error in logs when sending push messages
Problem description:
Whenever I send push messages, I encounter an error in the logs. The error message in the logs is as follows:
Unable to read stream contents: stream_get_contents(): Argument #1 ($stream) must be of type resource, int given
The error occurs in Guzzle, specifically in the file /guzzlehttp/psr7/src/Utils.php:424. The exception is thrown by the object initialized in minishlink/web-push/src/MessageSentReport.php:127.
While this error doesn't affect the functionality and the push messages are successfully delivered, it clutters the logs and makes them difficult to read.
Steps to reproduce:
Create a new push message using the provided code example:
public function toWebPush()
{
return (new WebPushMessage)
->title(__('common.reminder.push.title'))
->icon('/pwa/icons/manifest-icon-512.png')
->body(__('common.reminder.push.description'));
}
Environment:
- PHP version 8.2.10
- Laravel v10.23.1
- Package version 7.1.0