Skip to content

refactor(workflows): give ui_config its own independent read path#3710

Closed
vegaro wants to merge 4 commits into
cesar/workflows-offerings-fallbackfrom
cesar/workflows-ui-config-independent-read-path
Closed

refactor(workflows): give ui_config its own independent read path#3710
vegaro wants to merge 4 commits into
cesar/workflows-offerings-fallbackfrom
cesar/workflows-ui-config-independent-read-path

Conversation

@vegaro

@vegaro vegaro commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

  • PublishedWorkflow.uiConfig was parsed with a default and immediately overwritten from a separate ui_config topic read — UiConfig isn't workflow-scoped. Removes the field and adds a symmetric read path: PurchasesOrchestrator.getUiConfig / Purchases.awaitGetUiConfig, mirroring getWorkflow/awaitGetWorkflow at every layer.
  • Wires the new awaitGetUiConfig() read path into PaywallViewModel's workflow presentation, threading a UiConfig parameter through the presentation pipeline alongside the existing workflow/offerings chain.
  • Restores WorkflowAssetPreDownloader's font pre-download, wired to the same uiConfig, and lets injectedWorkflow (paywall-tester/previews) carry its own uiConfig via PaywallOptions.

Stacked on #3709.

Test plan

  • :purchases:testDefaultsBc8DebugUnitTest
  • :ui:revenuecatui:testDefaultsBc8DebugUnitTest

vegaro and others added 4 commits July 3, 2026 13:24
…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.
@vegaro

vegaro commented Jul 6, 2026

Copy link
Copy Markdown
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.

@vegaro vegaro closed this Jul 6, 2026
@vegaro vegaro deleted the cesar/workflows-ui-config-independent-read-path branch July 6, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant