You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The more I learn about mercure, the more I get the impression that it wasn't designed for multi-page sites.
I use Dockge to see the mercure server logs in real time.
For about 1 month I've been struggling to get the basic functions and so far I've just managed to subscribe to a topic and to subscribe to the presence endpoint topic (.well-known/mercure/subscriptions/) of a user who owns the same topic. I see that the other user's status changes from active: true to active:false when he changes page.
And the server console tells me “Subscriber disconnected” and then “New subscriber” within a second, because he subscribes again each time he changes page. Which is problematic, I can't send a notification to say “your subscriber has just disconnected” when he's only changed page and subscriber id.
How do I know that this new subscriber-id corresponds to my PHP user_id?
Is it a good practice to store the php user_id in the topic?
Or all of this is just impossible since we lose the subscriber-id at each page change, i have to stay on a fullJS single page website ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The more I learn about mercure, the more I get the impression that it wasn't designed for multi-page sites.
I use Dockge to see the mercure server logs in real time.
For about 1 month I've been struggling to get the basic functions and so far I've just managed to subscribe to a topic and to subscribe to the presence endpoint topic (.well-known/mercure/subscriptions/) of a user who owns the same topic. I see that the other user's status changes from active: true to active:false when he changes page.
And the server console tells me “Subscriber disconnected” and then “New subscriber” within a second, because he subscribes again each time he changes page. Which is problematic, I can't send a notification to say “your subscriber has just disconnected” when he's only changed page and subscriber id.
How do I know that this new subscriber-id corresponds to my PHP user_id?
Is it a good practice to store the php user_id in the topic?
Or all of this is just impossible since we lose the subscriber-id at each page change, i have to stay on a fullJS single page website ?
Beta Was this translation helpful? Give feedback.
All reactions