fastapi_websocket_pubsub icon indicating copy to clipboard operation
fastapi_websocket_pubsub copied to clipboard

fix: error handling and logging

Open daveads opened this issue 1 year ago • 5 comments

fix: improve error handling and logging in EventBroadcaster

  • Add dedicated connection method with proper error handling and logging
  • Improve error visibility by logging connection failures at ERROR level
  • Add more descriptive error messages including problematic URLs

This improves visibility of broadcast connection issues like DNS resolution failures that were previously being swallowed. Fixes issue where typos in broadcast URIs could go unnoticed due to insufficient error logging.

https://github.com/permitio/opal/issues/716

daveads avatar Dec 13 '24 01:12 daveads

Hi @daveads - thanks for your efforts here - much appreciated. While the code seems okay - I don't think this is the right way to approach https://github.com/permitio/opal/issues/716 and https://github.com/permitio/opal/issues/711 ; As the issue here isn't that this library (fastapi_websocket_pubsub) is swallowing the errors- but that the OPAL code using it is / is using the wrong log level for communicating them.

In addition the tests are currently hanging / failing. I'd advise closing this PR and addressing the issues in OPAL itself

CC: @gemanor , @danyi1212

orweis avatar Dec 16 '24 09:12 orweis

Hi @daveads - thanks for your efforts here - much appreciated. While the code seems okay - I don't think this is the right way to approach permitio/opal#716 and permitio/opal#711 ; As the issue here isn't that this library (fastapi_websocket_pubsub) is swallowing the errors- but that the OPAL code using it is / is using the wrong log level for communicating them.

In addition the tests are currently hanging / failing. I'd advise closing this PR and addressing the issues in OPAL itself

CC: @gemanor , @danyi1212

I’ll check this out later to debug further. In the meantime, the PR can be closed.

daveads avatar Dec 16 '24 11:12 daveads

@orweis, could you run these tests locally? I found out they were failing on the master branch as well, not just in this PR.

daveads avatar Dec 16 '24 11:12 daveads

In that case I'd need to ask @obsd and @danyi1212 to look at them

orweis avatar Dec 16 '24 11:12 orweis

In that case I'd need to ask @obsd and @danyi1212 to look at them

sure...

daveads avatar Dec 16 '24 11:12 daveads