Skip to content

Releases: pubnub/go

v9.0.1

15 Jun 09:06
7052212

Choose a tag to compare

June 15 2026

Fixed

  • Fix version naming back from "X.X.X" to "vX.X.X".

v9.0.0

08 Jun 09:41
bafabef

Choose a tag to compare

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/net to v0.55.0.

8.2.0

28 May 07:02
18ecacb

Choose a tag to compare

May 28 2026

Added

  • Config.UseHTTP2 now defaults to true and NewHTTP2Client is rebuilt on net/http.Transport with ForceAttemptHTTP2 + 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.Client across long-poll cycles, and on SubscriptionManager.reconnect SDK-managed clients are dropped so the next request re-runs TLS+ALPN — user-supplied clients pinned via SetClient/SetSubscribeClient are preserved. Set UseHTTP2 = false to opt out.
  • Network response log messages now carry the OperationType and the negotiated protocol from *http.Response.Proto. The formatted line becomes PubNub request completed: operation=<Op> protocol=<HTTP/x.y> status=<n> url=<…> body=<…>, and the value is also retained on the PubNub instance as lastNegotiatedProto for internal use. No public API change.

Fixed

  • Destroy previously dereferenced pn.client unconditionally, read the field without holding pn.Lock, and never closed pn.subscribeClient (most impactful on HTTP/2 where one long-lived session per origin holds the only physical connection). The new closeManagedHTTPClients snapshots both clients under pn.Lock, clears the pointers, and calls CloseIdleConnections outside the lock on whichever clients are non-nil.

Modified

  • Add a generic eventually polling test helper and update the gotestsum-based runner to automatically retry failing tests up to 3 times.

v8.1.0

17 Nov 10:21
7875b2f

Choose a tag to compare

November 17 2025

Added

  • Add new logging system with LoggerManager supporting multiple custom loggers, structured log message types (network requests/responses, errors, user inputs), and PNLogger interface. Includes DefaultLogger with 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

29 Oct 10:40
869dc95

Choose a tag to compare

October 29 2025

Added

  • Add UseRawMessage parameter to SendFile and PublishFileMessage functions - when enabled, message content is sent as-is without wrapping in a "text" JSON field.
  • Add CustomMessageType parameter to PublishFileMessage function to enable custom message type specification.
  • Add Status and Type fields to App Context objects (Channel and UUID Metadata, Channel Members and Memberships).
  • Add IfMatchETag method to SetChannelMetadata and SetUUIDMetadata to enable conditional updates that prevent overwriting metadata without fetching the latest version first.
  • The HereNow method 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 (new Limit and Offset parameters) 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 ShouldStore parameter was not being added to SendFile requests. Now correctly defaults to false. BREAKING CHANGE.
  • Fix bug where SendFile function was not including Meta and other parameters in the request.
  • Fix bug where Fire method was not correctly including Meta parameter in the request.

Modified

  • Remove PNPushTypeMPNS push type entirely, deprecate PNPushTypeGCM and PNPushTypeAPNS, and add new PNPushTypeFCM type for Firebase Cloud Messaging. BREAKING CHANGE.
  • Change PNPublishMessage.Text parameter type from string to interface{} to enable sending arbitrary JSON types in published file messages. BREAKING CHANGE.
  • Remove not supported Reverse parameter from Fetch function. BREAKING CHANGE.
  • Rename status field to Status in 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 GoTestSum for improved test output formatting and readability.

v7.4.0

11 Sep 10:02
24c41bd

Choose a tag to compare

September 11 2025

Added

  • Add an PNDisconnectedUnexpectedlyCategory announcement in case of server / connection errors after the initial / handshake subscription.

Fixed

  • Fix deadlock that could happen during unsubscribe in stopHeartbeatTimer function.

v7.3.4

08 May 11:56
f51c9fc

Choose a tag to compare

May 08 2025

Modified

  • Revert golang.org/x/net to the safest version.

v7.3.3

07 May 12:07
5a860f2

Choose a tag to compare

May 07 2025

Modified

  • Update Go SDK dependencies to fix Snyk vulnerability. Remove Gopkg files.

v7.3.2

21 Mar 08:43
1d656d8

Choose a tag to compare

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

06 Mar 09:20
b9bf223

Choose a tag to compare

March 06 2025

Modified

  • Update go sdk dependencies to fix GH Dependabot vulnerabilities (end of support for Go 1.16 and 1.17).