Fix silent serialization failure when publishing non-JSON-serializable objects#229
Fix silent serialization failure when publishing non-JSON-serializable objects#229jguz-pubnub merged 3 commits intomasterfrom
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
| except TypeError as e: | ||
| exc = PubNubException( | ||
| errormsg=str(e), | ||
| pn_error=PNERR_JSON_NOT_SERIALIZABLE | ||
| ) | ||
| status = PNStatus() | ||
| status.category = PNStatusCategory.PNSerializationErrorCategory | ||
| status.error = True | ||
| status.error_data = PNErrorData(str(exc), exc) | ||
| exc.status = status | ||
| raise exc |
There was a problem hiding this comment.
The error structure has a circular reference, PubNubException.status.error_data.exception points back to the same PubNubException. This PR implements a fix that works within the current model to prevent regressions, but the error hierarchy would benefit from being revisited in the future
There was a problem hiding this comment.
Nice! Good find and fast fix thank you 🎉
There was a problem hiding this comment.
Thanks for the quick fix, I reported this to @stephenlb first at 2:48am IST and less than 24hrs it's fixed!
This was discovered by using a custom agent creating a tool on the fly in remote VPSs instance.
|
@pubnub-release-bot release |
|
🚀 Release successfully completed 🚀 |
fix: fix silent serialization failure when publishing non-JSON-serializable objects