Skip to content

Conversation

@nalcalag
Copy link
Contributor

@nalcalag nalcalag commented Nov 21, 2025

Task/Issue URL: https://app.asana.com/1/137249556945/project/488551667048375/task/1211542241177650?focus=true

Description

Add wide event for switch flow

Steps to test this PR

Pre steps

Test 1: Successful Upgrade (Monthly → Yearly)

  • Install from branch
  • Buy a monthly test subscription and wait for Free Trial to finish (3 minutes)
  • Navigate to Subscription Settings
  • Click in Switch to yearly option
  • Verify switch confirmation dialog appears
  • Click "Switch to Yearly" button in the dialog
  • Complete the Play Billing flow
  • Verify in logcat that all steps are recorded:
    • validate_current_subscription.success = true
    • retrieve_target_plan.success = true
    • billing_flow_switch.success = true
    • confirm_switch.success = true
    • ui_refresh
  • Verify wide event pixel is sent with:
    • context.name = "subscription_settings"
    • from_plan = "ddg.privacy.pro.monthly.renews.[us|row]"
    • to_plan = "ddg.privacy.pro.yearly.renews.[us|row]"
    • switch_type = "upgrade"
    • activation_latency_ms_bucketed with a value
    • feature.status = SUCCESS

Test 2: Successful Downgrade (Yearly → Monthly)

  • Navigate to Subscription Settings with a yearly subscription
  • Click "Switch to Monthly" option
  • Verify switch confirmation dialog appears
  • Click "Switch to Monthly" button in the dialog
  • Complete the Play Billing flow
  • Verify in logcat that all steps are recorded
  • Verify wide event pixel is sent with:
    • from_plan = "ddg.privacy.pro.yearly.renews.[us|row]"
    • to_plan = "ddg.privacy.pro.monthly.renews.[us|row]"
    • switch_type = "downgrade"
    • feature.status = SUCCESS

Test 3: User Cancels in Play Billing Flow

  • Navigate to Subscription Settings
  • Click switch plan option and confirm in the dialog
  • Cancel/back out in the Google Play Billing screen
  • Verify wide event pixel is sent with:
    • feature.status = CANCELLED

Test 4: Billing Flow Error

  • Start switch flow
  • Use a test card that always declines (if available in test environment)
  • Complete the Play Billing flow with the failing card
  • Verify wide event pixel is sent with:
    • feature.status = FAILURE
    • feature.data.ext.error contains billing error details
    • billing_flow_switch.success = false

Test 5: Switch from Dev Settings (Optional)

  • Go to Settings > Subscriptions dev settings
  • Use the "Switch Subscription" option
  • Complete a switch
  • Verify wide event pixel is sent with:
    • context.name = "dev_settings"
    • feature.status = SUCCESS

Test 6: Feature Flag Disabled

  • Go to Feature Flag inventory
  • Disable sendSubscriptionSwitchWideEvent
  • Perform a complete switch flow (upgrade or downgrade)
  • Verify that NO wide event pixels are sent during the switch flow

Test 7: Multiple Switch Attempts

  • Perform multiple switch operations (e.g., upgrade then downgrade)
  • Verify count pixel (.c) is sent on every switch attempt
  • Verify daily pixel (.d) is sent at most once per day
  • Verify global.sample_rate = 1 in all events

Test 8: Wide Event Metadata Validation
For any successful switch, verify all required fields are present:

  • context.name (e.g., "subscription_settings", "dev_settings")
  • feature.name = "subscription-switch"
  • feature.status (SUCCESS/FAILURE/CANCELLED)
  • feature.data.ext.from_plan
  • feature.data.ext.to_plan
  • feature.data.ext.switch_type (upgrade/downgrade)
  • feature.data.ext.activation_latency_ms_bucketed (when billing successful)
  • All recorded step success/failure indicators
  • Android common wide event fields (app.name, app.version, app.form_factor, etc.)

No UI changes

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant