Skip to content

Add WorkflowType enum with feedback-survey support#3495

Draft
facumenzella wants to merge 1 commit into
mainfrom
port/6815
Draft

Add WorkflowType enum with feedback-survey support#3495
facumenzella wants to merge 1 commit into
mainfrom
port/6815

Conversation

@facumenzella
Copy link
Copy Markdown
Member

Port of RevenueCat/purchases-ios#6815

Summary

  • Introduces WorkflowType enum (PAYWALL, WEB_FUNNEL, FEEDBACK_SURVEY, UNKNOWN) to WorkflowModels.kt
  • Adds optional workflowType: WorkflowType? field to PublishedWorkflow so the Android SDK can identify feedback-survey workflows from the backend response
  • Unknown values decode to UNKNOWN via EnumDeserializerWithDefault with an explicit key map (required because "web-funnel" and "feedback-survey" use hyphens, not underscores)
  • Missing field decodes as null for backwards compatibility

Deviations from iOS

  • No warning log on unknown type — follows the existing Android pattern (WorkflowTriggerType also silently falls back to UNKNOWN)

Test plan

  • WorkflowTypeDeserializationTests covers all 3 known types, unknown type → UNKNOWN, and future unknown string → UNKNOWN
  • PublishedWorkflowTest covers JSON decoding of all 3 known types, unknown string → UNKNOWN, and missing field → null
  • ./gradlew :purchases:testDefaultsBc8DebugUnitTest --tests "com.revenuecat.purchases.common.workflows.*" passes

🤖 Generated with Claude Code

Port of RevenueCat/purchases-ios#6815

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@facumenzella facumenzella added the pr:feat A new feature label May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:feat A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant