Closed franky47 closed 3 years ago
Hi @franky47,
Thank you so much for the research you've done! 🔥
I personally prefer Approach B as:
I'm OK with both approaches though.. If you're planning to implement this, feel free to go ahead with whatever you prefer 🚀
Note that the 5 minutes are the maximum time between "nothing changed" updates. I supposed (but haven't checked) that failures are reported in real time, in which case they'd be caught within the 5 seconds (max) of Out's polling.
Oh Ok that's awesome :D let's try either approach then :D
After leaving a connection open for a while, I did not get anymore status updates, so I guess solution B is indeed better, as this way we're sure not to miss anything. I'll see how I can kill the connection after the initial state is received, hopefully that can be done without adding extra dependencies.
Note: EventSource may not be the wisest choice for long-term maintenance, as it shows some lack of interest by the Chrome team and w3c. Examples include the inability to pass headers to the underlying request (which will be the subject of an upcoming PR): https://github.com/whatwg/html/issues/2177
I use Bitwarden as my password manager. Their status page is powered by Hund, which unfortunately does not seem to have a simple JSON endpoint to ping for updates, but instead uses a live event stream of Server-Sent Events.
In order to obtain the status from Hund-based services, there could be a few approaches:
Approach A: following the SSE protocol
updateStatus
Pros:
Cons:
curl
, I haven't checked with Axios).Approach B: polling
updateStatus
Pros:
Cons: