Closed MaartenW closed 1 year ago
FWIW I hash the endpoint, each should be unique, and associate it with a subscription. Then when you flush at the end, hash the endpoint URI of all 410s, then use it to get the associated subscription.
Ideally, the $report->getSubscription()
method would exist, but so long as endpoints remain unique, there shouldn't be an issue with my way
Thanks @andy-UKC, I think that would easily solve it.
NOTE: Please test in a least two browsers (i.e. Chrome and Firefox). This helps with diagnosing problems quicker.
Setup
Server side, general concept.
Problem
When iterating over reports after
$webPush->flush()
how to find which subscription the report belongs to? I'd like to clean any410 Gone
subscriptions.Expected
I would expect something like
$report->getSubscription()
to be able to get the subscription from the report and handle errors.Features Used
Example / Reproduce Case
Other