1029f08fba
- scenarios.md rewritten for server-side execution + effects API - realtime.md deleted; realtime/planstore references purged from docs - CHANGELOG Unreleased: major bump + migration table
8.3 KiB
8.3 KiB
Changelog
Unreleased
Breaking change — major bump. The local scenario engine is replaced by a server-driven effects client; the realtime websocket client is removed.
Removed
- Local scenario runtime:
PlanRun,ExecutionPlanwalking, node sessions (NotificationSession,StoreOfferSession,LeaderboardSession,WaitSession,QuestSession,BattlePassSession,BattlePassLevelSession,ConfigChangedSession),RespondAsync/Respond,RestoreAsync,Clear,ActiveRuns,IsRunning,CurrentNodeId,OnConfigChanged. RudderClientOptions.PlanStateStore/IPlanStateStoreandIPlanScheduler— no local plan persistence or delayed plan work.RealtimeService(client.Realtime),RudderClientOptions.RealtimeUrl/RealtimeTransportFactory,IRealtimeTransport/IRealtimeTransportFactory.
Changed (breaking)
client.Scenariois a trigger only:TriggerAsync(eventName)returnsTask(not started plans). Returned pending effects are ingested intoclient.Effects.- Subscribe to
client.Effects.On*instead ofclient.Scenario.On*. Sessions are now effect objects (NotificationEffect,StoreOfferEffect, …). Complete them with the methods on the effect (DoneAsync,PurchaseAsync/DeclineAsync,EndAsync/ClaimAsync, …). client.Update(deltaTime)is still required every frame — it now pumps the effects client (30sGET /sdk/v1/scenarios/pendingheartbeat + wait-deadline checks), not a local DAG or a websocket.- After login (or when constructed with a stored access token), the next
Updatefetches pending effects. There is nologinEventoption; trigger login-gated scenarios yourself.
Migration
| Before | After |
|---|---|
client.Scenario.OnNotification (and other On*) |
client.Effects.OnNotification (same event names) |
NotificationSession / StoreOfferSession / … |
NotificationEffect / StoreOfferEffect / … |
session.CompleteAsync() / RespondAsync("output") |
effect.DoneAsync() (and the matching method on each effect) |
RudderClientOptions.PlanStateStore + RestoreAsync |
gone — server owns run state; pending fetch after login + heartbeat |
client.Realtime |
gone |
client.Update(deltaTime) |
still required (effects pump) |
0.4.0
- Generated DTOs live under
Models/(RudderSdk.Core.Models). Wire fields are nullable.ListQuestsRequestis gone;Quests.ListAsyncPOSTs with no body.BoundaryNode.WaitDeadlineisDateTimeOffset?. LeaderboardSession.ClaimAsync/Claimcomplete the leaderboard node with handleonClaim. The server matches live rank to an authored place.RewardClaimedAsync/RewardClaimedare obsolete aliases and will be removed in the next SDK version.rank_not_eligibleon Claim leaves the session open (retry Claim or End); it no longer fails the run.
0.3.0
Removed
- UGC surface:
UgcService(client.Ugc), the generatedRudderSdk.Core.Models.UgcDTOs,IUploadTransportandRudderClientOptions.UploadTransport. The server no longer exposes the UGC endpoints.
Changed (breaking)
BattlePassServicesimple overloads sent empty scenario/node ids and always failed server-side. Battle pass state is tied to a scenario battle pass node, so the public API now mirrors the web SDK:GetProgressAsync(scenarioId, nodeId)and the request-DTO overloadsAddXpAsync,ClaimRewardAsync,PurchasePremiumAsync(carryingScenarioId/NodeId/RunId) are public; the internal request overloads are gone.BattlePassSessionnow exposes the bound battle pass operations (GetProgressAsync,AddXpAsync(source, amount),ClaimRewardAsync(level, track),PurchasePremiumAsync()— crossesonPremiumPurchaseon success), mirroring the web SDK session.BattlePassLevelSession.CompleteAsync/Completerenamed toClaimAsync/Claim; newLevelproperty reads thelevelNumbernode data key.- Unsupported scenario node types now fail the run (
OnScenarioFailed) instead of stalling silently. - Scenario counter updates no longer read a continuation plan from the
response (the server stopped returning one); when the server reports the
objective completed, the node crosses
onComplete.
Fixed
- A failed scenario counter update no longer fails the run; the error is logged and the node stays active.
0.2.0
Added
QuestsService(client.Quests) withListAsync/ClaimAsync.AuthService.LoginWithDeviceAsync(region, language, nickname?)andAuthService.RefreshAsync();AuthStateChangedevent (RudderAuthState.SignedIn/SignedOut).- Session pipeline: single-flight token refresh plus one transparent
retry-on-401 for every API call; failed refresh clears tokens and reports
SignedOut. HttpClientTransport— defaultSystem.Net.Http.HttpClient-based transport.RudderClientOptions.Transportis now optional, as areTokenStore(InMemoryTokenStore) andDeviceIdProvider(GuidDeviceIdProvider).- Typed exceptions:
RudderAuthException(401),RudderNotFoundException(404),RudderRateLimitException(429),RudderNetworkException(network/timeout). All carryRequestIdfrom the server error payload. StorageService.ListAllAsyncandUgcService.ListAllAsync(IAsyncEnumerable<T>cursor pagination helpers).RudderLogLevelenum;IRudderLogger.Lognow takes a level.- Package metadata (
Rudder.Core, MIT) and XML documentation.
Changed (breaking)
- Generated models moved to domain folders/namespaces
(
RudderSdk.Core.Models.<Domain>); the flatRudderSdk.Core.DTOnamespace is gone.Battlepass*→BattlePass*,SdkQuest→Quest. BattlepassService→BattlePassService,client.Battlepass→client.BattlePass.client.Scenarios→client.Scenario.ScenarioService.SendAsync→TriggerAsync, now returning the startedPlanRuns.- Scenario events reduced to the canonical set:
OnNotification,OnStoreOffer,OnLeaderboard,OnConfigChanged,OnWait,OnQuest,OnBattlePass,OnBattlePassLevel,OnScenarioCompleted,OnScenarioFailed. Legacy events (OnShowNotification,OnShowStore,OnQuestEvent,OnBattlepassEvent,OnLeaderboardEvent,OnNodeEvent,OnNode,OnCompleted,OnStore,OnRemoteConfigOverride,OnRunCompleted,OnRunFailed) are removed, along with theServices/Scenarios/Legacyfolder. - Session types renamed:
StoreSession→StoreOfferSession(BuyAsync/Buy→PurchaseAsync/Purchase),RemoteConfigOverrideSession→ConfigChangedSession,BattlepassSession→BattlePassSession,BattlepassLevelSession→BattlePassLevelSession,ScenarioRunFailedEvent→ScenarioFailedEvent. StoresService.BuyAsync→PurchaseAsync(storeSlug, offerId, idempotencyKey = null); a null key is replaced with a generated GUID.InventoryService.GetAsyncreturnsIReadOnlyList<PlayerInventoryItem>.StoresService.ListAsyncreturnsIReadOnlyList<Store>.QuestsService.ListAsyncreturnsIReadOnlyList<Quest>.UgcService.GetDownloadUrlAsyncreturns non-nullstringand throwsInvalidOperationExceptionwhen the server returns no URL.BattlePassServicesimple overloads (AddXpAsync(long amount),ClaimRewardAsync(level, track),GetProgressAsync(),PurchasePremiumAsync(idempotencyKey?)); the request-DTO overloads are internal for the scenario runtime.LeaderboardsService.GetRankingAsync/SubmitScoreAsyncare internal; use theFindBySlug(slug)handle (SubmitAsync,ListAsync).AuthService.LoginViaDeviceAsyncremoved; useLoginWithDeviceAsync.ScenarioService.Restore()(sync-over-async) removed; useRestoreAsync.RealtimeService.ConnectAsyncandIRealtimeTransport.ConnectAsynctakeTimeSpantimeouts instead ofint timeoutSeconds.IRudderTransport.SendAsynctakes astring? accessTokeninstead ofRequestOptions;RequestOptionsis removed andEmptyResponseis internal.RudderClientgettersOptions,Transport,TokenStore,DeviceIdProviderare internal.RudderApiException.StatusCodeisint(waslong).IRudderLogger.Log(string)→Log(RudderLogLevel level, string message).- Nullable reference types enabled (
<Nullable>enable</Nullable>). - Remote config cache now includes every config except an explicit
"active": false(a missing flag means active).