Skip to content

Conversation

@jguz-pubnub
Copy link
Contributor

@jguz-pubnub jguz-pubnub commented Feb 9, 2026

fix: fix silent serialization failure when publishing non-JSON-serializable objects

@jguz-pubnub jguz-pubnub requested a review from parfeon as a code owner February 9, 2026 12:23
@pubnub-ops-terraform
Copy link

pubnub-ops-terraform commented Feb 9, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Comment on lines +33 to +43
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
Copy link
Contributor Author

@jguz-pubnub jguz-pubnub Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

@stephenlb stephenlb Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Good find and fast fix thank you 🎉

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

@parfeon parfeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jguz-pubnub
Copy link
Contributor Author

@pubnub-release-bot release

@jguz-pubnub jguz-pubnub merged commit 23abadc into master Feb 10, 2026
13 checks passed
@jguz-pubnub jguz-pubnub deleted the fix/serialization-failure branch February 10, 2026 11:20
@pubnub-release-bot
Copy link
Contributor

🚀 Release successfully completed 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants