Releases: pubnub/go
Releases · pubnub/go
v9.0.1
v9.0.0
June 08 2026
Modified
- Bump minimum supported Go version to 1.25. BREAKING CHANGE.
- Remove legacy code and files related to unsupported Go versions.
- Update
golang.org/x/netto v0.55.0.
8.2.0
May 28 2026
Added
Config.UseHTTP2now defaults totrueandNewHTTP2Clientis rebuilt onnet/http.TransportwithForceAttemptHTTP2+http2.ConfigureTransport, so HTTPS connections prefer HTTP/2 via TLS ALPN and fall back to HTTP/1.1 when the origin doesn't advertise h2. The single subscribe loop reuses the cached*http.Clientacross long-poll cycles, and onSubscriptionManager.reconnectSDK-managed clients are dropped so the next request re-runs TLS+ALPN — user-supplied clients pinned viaSetClient/SetSubscribeClientare preserved. SetUseHTTP2 = falseto opt out.- Network response log messages now carry the
OperationTypeand the negotiated protocol from*http.Response.Proto. The formatted line becomesPubNub request completed: operation=<Op> protocol=<HTTP/x.y> status=<n> url=<…> body=<…>, and the value is also retained on thePubNubinstance aslastNegotiatedProtofor internal use. No public API change.
Fixed
Destroypreviously dereferencedpn.clientunconditionally, read the field without holdingpn.Lock, and never closedpn.subscribeClient(most impactful on HTTP/2 where one long-lived session per origin holds the only physical connection). The newcloseManagedHTTPClientssnapshots both clients underpn.Lock, clears the pointers, and callsCloseIdleConnectionsoutside the lock on whichever clients are non-nil.
Modified
- Add a generic
eventuallypolling test helper and update the gotestsum-based runner to automatically retry failing tests up to 3 times.
v8.1.0
November 17 2025
Added
- Add new logging system with
LoggerManagersupporting multiple custom loggers, structured log message types (network requests/responses, errors, user inputs), and PNLogger interface. IncludesDefaultLoggerwith configurable log levels and detailed SDK operation logging. The new Config.Loggers field replaces deprecated Config.Log while maintaining backward compatibility.
Modified
- Refactor logs across the whole SDK. Now logs have dedicated structure and type, so only intended type will be printed. There is now much more logs, especially in internal systems.
- Deprecate the old Logger. The old logger is still working (for backward compatibility) and is default to
PNLogLevelDebug.
v8.0.0
October 29 2025
Added
- Add
UseRawMessageparameter toSendFileandPublishFileMessagefunctions - when enabled, message content is sent as-is without wrapping in a "text" JSON field. - Add
CustomMessageTypeparameter toPublishFileMessagefunction to enable custom message type specification. - Add
StatusandTypefields to App Context objects (Channel and UUID Metadata, Channel Members and Memberships). - Add
IfMatchETagmethod toSetChannelMetadataandSetUUIDMetadatato enable conditional updates that prevent overwriting metadata without fetching the latest version first. - The
HereNowmethod now returns a maximum of 1,000 occupants per channel. Previously, it would return all occupants regardless of count. If you have channels with more than 1,000 occupants, you must use pagination (newLimitandOffsetparameters) to retrieve the complete list. BREAKING CHANGE. - Add testable code snippets with examples for all API endpoints. Fix old snippets and remove outdated ones.
Fixed
- Fix bug where
ShouldStoreparameter was not being added toSendFilerequests. Now correctly defaults to false. BREAKING CHANGE. - Fix bug where
SendFilefunction was not includingMetaand other parameters in the request. - Fix bug where
Firemethod was not correctly includingMetaparameter in the request.
Modified
- Remove
PNPushTypeMPNSpush type entirely, deprecatePNPushTypeGCMandPNPushTypeAPNS, and add newPNPushTypeFCMtype for Firebase Cloud Messaging. BREAKING CHANGE. - Change
PNPublishMessage.Textparameter type from string to interface{} to enable sending arbitrary JSON types in published file messages. BREAKING CHANGE. - Remove not supported
Reverseparameter fromFetchfunction. BREAKING CHANGE. - Rename status field to
Statusin response structures to fix JSON marshalling and linter errors. - Add missing unit and e2e tests for all API endpoints to improve code coverage.
- Change testing script to use
GoTestSumfor improved test output formatting and readability.
v7.4.0
September 11 2025
Added
- Add an
PNDisconnectedUnexpectedlyCategoryannouncement in case of server / connection errors after the initial / handshake subscription.
Fixed
- Fix deadlock that could happen during unsubscribe in
stopHeartbeatTimerfunction.
v7.3.4
May 08 2025
Modified
- Revert golang.org/x/net to the safest version.
v7.3.3
May 07 2025
Modified
- Update Go SDK dependencies to fix Snyk vulnerability. Remove Gopkg files.
v7.3.2
March 21 2025
Fixed
- Add handling panic while destroying the pubnub client in case pn.jobQueue is already closed. Thanks @piyushkumar96 for your contribution!. Fixed the following issues reported by @piyushkumar96: #161.
v7.3.1
March 06 2025
Modified
- Update go sdk dependencies to fix GH Dependabot vulnerabilities (end of support for Go 1.16 and 1.17).