Repository navigation
docs: add 3.0.0 sample snippets and fix the client lookup in samples - #69
Merged
Merged
Conversation
Add snippets for SetUserID, GetUserID, SetOrigin, GetOrigin, DisconnectSubscriptions, ReconnectSubscriptions, and publish with compression. Fix the get_pubnub_client snippet and the sample client helpers, which relied on the client that UPubnubSettings created automatically before 3.0.0. Update the supported Unreal Engine versions in the README to 5.0-5.8 from source and 5.2-5.8 through Fab. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
techwritermat
requested review from
KGronek-Pubnub,
Xavrax,
jakub-grzesiowski and
kazydek
as code owners
November 4, 2026 08:01
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the docs snippets that 3.0.0 is missing and fixes samples that still assumed the automatic client from the removed
UPubnubSettings.New snippets
set_user_idSample_ConfigurationSetUserID, then checksFPubnubOperationResult::Errorget_user_idSample_ConfigurationGetUserIDset_originSample_ConfigurationSetOrigin, then checks the result. An empty origin resets to the defaultget_originSample_ConfigurationGetOrigindisconnect_subscriptionsSample_ConfigurationDisconnectSubscriptions, then checks the resultreconnect_subscriptionsSample_ConfigurationReconnectSubscriptionswith the default timetoken, then checks the resultpublish_with_compressionSample_PubSubPublishMethod = PPM_SendViaPOSTandCompress = PPC_Yes, thenPublishMessageAsyncEach marker is in both the header and the cpp, with
snippet.hide/snippet.showaround the client lookup, same as the existing samples.GetUserIDSample,GetOriginSample, andPublishWithCompressionSampleare registered inRunSamples. The set, disconnect, and reconnect samples are not, because they change client state for the other samples.Fixes
get_pubnub_clientsnippet: removed the "created automatically if PluginSettings are set" comment and theSetUserIDcall. It now explains that the first client you create has ID 0 and logs a warning whenGetPubnubClient(0)returnsnullptr.GetPubnubClient()helpers in 14 sample files calledGetPubnubClient(0)and then dereferenced it. In 3.0.0 no client exists until you create one, so this was a null dereference. They now call a new protectedAPubnubSampleBase::GetOrCreateSampleClient()that returns client 0 or creates it with demo keys andUserIDplayer_001.ASample_Configuration::RunSamplescalls it first so its ownget_pubnub_clientsnippet finds the client.InitializeAutomaticallyassumption withCreatePubnubClientandFPubnubConfig..pubnub.yml.How verified
No Unreal Engine is available, so nothing was compiled or run. Verified by review only:
PubnubClient.h(SetUserID,GetUserID,SetOrigin,GetOrigin,ReconnectSubscriptions,DisconnectSubscriptions),PubnubStructLibrary.h(FPubnubPublishSettings::PublishMethod,Compress,FPubnubOperationResult::ErrorMessage),PubnubEnumLibrary.h(PPM_SendViaPOST,PPC_Yes) andPubnubSubsystem.cpp(client IDs start at 0,GetPubnubClientreturnsnullptrfor unknown IDs).🤖 Generated with Claude Code