refactor(workflows): give ui_config its own independent read path#3710
Closed
vegaro wants to merge 4 commits into
Closed
refactor(workflows): give ui_config its own independent read path#3710vegaro wants to merge 4 commits into
vegaro wants to merge 4 commits into
Conversation
…dpoint WorkflowManager stays the consumer-facing seam but becomes a thin adapter over WorkflowsConfigProvider, which reads the `workflows` topic through RemoteConfigManager's topic()/body() facade. The old backend-per-workflow path is unwired: no Backend.getWorkflow, no CDN envelope resolution, no WorkflowsCache reads, no stale-while-revalidate, and offerings no longer fan out a workflows-list fetch. ui_config is served from its own topic: UiConfigProvider assembles the `app`, `localizations` and `variable_config` parts into one UiConfig and the workflow parser swaps it in (PublishedWorkflow.uiConfig now defaults instead of failing when absent). The workflowIdForOfferingId chain (Purchases → orchestrator → manager → provider) becomes suspend so topic reads run on the manager's IO dispatcher instead of the caller's thread; PaywallViewModel already calls it from a suspend context. PurchasesFactory constructs the RemoteConfigManager whenever useWorkflows is on (the config layer is now a prerequisite for workflows), keeping ENABLE_REMOTE_CONFIG as the standalone flag. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…fetch fails The /v1/config endpoint can be disabled for the session after a 4xx (the kill switch), be unreachable, or simply have no workflow for the offering yet. In all of those cases the offering still carries the paywall that /offerings delivered, so render that through the regular components path instead of surfacing PaywallState.Error — apps keep showing a paywall when the config layer can't serve one. The error state remains for offerings with nothing to fall back to. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PublishedWorkflow.uiConfig was parsed with a default and immediately overwritten from a separate ui_config topic read — UiConfig isn't workflow-scoped. Remove the field and add a symmetric read path: PurchasesOrchestrator.getUiConfig / Purchases.awaitGetUiConfig, mirroring getWorkflow/awaitGetWorkflow at every layer. WorkflowScreenMapper/PaywallViewModel wiring is left for a follow-up task; WorkflowAssetPreDownloader's font pre-download is temporarily a no-op since ui_config no longer lives on the workflow it receives.
…rkflow presentation Consumes the awaitGetUiConfig() read path added in the previous step from PaywallViewModel's workflow presentation, threading a UiConfig parameter through the presentation pipeline alongside the existing workflow/offerings chain now that PublishedWorkflow.uiConfig no longer exists. Also restores WorkflowAssetPreDownloader's font pre-download, wired to the same uiConfig, and lets injectedWorkflow (paywall-tester/previews) carry its own uiConfig via PaywallOptions.
Member
Author
This was referenced Jul 3, 2026
7ec5612 to
2db6417
Compare
Member
Author
|
Superseded by #3716, which wires the independent ui_config read path in directly as part of the WorkflowManager rewrite (no longer a separate follow-up PR). Closing this one. |
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
PublishedWorkflow.uiConfigwas parsed with a default and immediately overwritten from a separateui_configtopic read —UiConfigisn't workflow-scoped. Removes the field and adds a symmetric read path:PurchasesOrchestrator.getUiConfig/Purchases.awaitGetUiConfig, mirroringgetWorkflow/awaitGetWorkflowat every layer.awaitGetUiConfig()read path intoPaywallViewModel's workflow presentation, threading aUiConfigparameter through the presentation pipeline alongside the existing workflow/offerings chain.WorkflowAssetPreDownloader's font pre-download, wired to the sameuiConfig, and letsinjectedWorkflow(paywall-tester/previews) carry its ownuiConfigviaPaywallOptions.Stacked on #3709.
Test plan
:purchases:testDefaultsBc8DebugUnitTest:ui:revenuecatui:testDefaultsBc8DebugUnitTest