Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup Risk Messaging Feature #2089

Merged
merged 6 commits into from
Jun 27, 2024
Merged

Conversation

scottkicks
Copy link
Contributor

@scottkicks scottkicks commented Jun 26, 2024

📲 What

Removes the unused Optimizely Risk Messaging Experiment Feature.

🤔 Why

This extra, unused screen during checkout reminded people that backings weren't guaranteed and should have been removed when Optimizely was deprecated.

🛠 How

  • Removes RiskMessagingViewController/ViewModel
  • UpdatesPledgeViewModel checkout code that references isNativeRiskMessagingControlEnabled
    • This boolean had been defaulting to true for some time
    • Cleanup touches ApplePay and regular pledge code
  • Removes isNativeRiskMessagingControlEnabled from SharedFunctions
  • Removes func trackPledgeConfirmButtonClicked() from our analytics events because it was only used in the Risk Messaging flow.

👀 See

There should be no visible changes to the app.

✅ Acceptance criteria

  • Crowdfunding pledge flow experiences no changes for regular or ApplePay pledging
    • I've tested many projects in as many pledge scenarios as possible with multiple success/failure stripe cards. It will still be important to focus on testing this in our next release QA to make doubly sure I haven't broken something unexpected.
  • Updating Pledge via change payment and edit reward still works as expected

@scottkicks scottkicks self-assigned this Jun 26, 2024
@nativeksr
Copy link
Collaborator

1 Warning
⚠️ Big PR

Generated by 🚫 Danger

@scottkicks scottkicks requested review from a team and ifosli and removed request for a team June 26, 2024 18:22
@scottkicks scottkicks marked this pull request as ready for review June 26, 2024 18:46
Copy link
Contributor

@ifosli ifosli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good but I'm concerned that the behavior has changed a little (see comments for details). Will you make sure you also test this in the change pledge context if you haven't already? (Ie pledge with a fake card and go try to change your payment method to apple pay? Requires finding a project in staging that has real time left though or testing in prod)

self.goToApplePayPaymentAuthorization = paymentAuthorizationData
.takeWhen(goToApplePayPaymentAuthorization)
.takeWhen(self.applePayButtonTappedSignal)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain this change? The goToApplePayPaymentAuthorization only emitted when the pledge amount was valid, and now it looks like it'll emit regardless.

self.applePayButtonTappedSignal.filter(isNativeRiskMessagingControlEnabled),
applePayButtonTappedAndIsChangingPaymentMethod,
self.riskMessagingViewControllerDismissedProperty.signal.skipNil().filter(isTrue).ignoreValues()
let applePayButtonTappedAndOrIsChangingPaymentMethod = Signal.merge(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this entire signal should just be self.applePayButtonTappedSignal instead (since we're always in the control of the experiment now). The way it's currently written, if the apple pay button is tapped in the change pledge context, the signal looks like it'll emit twice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hear you. There are XCTAssertEquals assertions in the tests for this that compare arrays, so if it was emitting twice, I would think those would catch it.

I think you're suggestion reads more clearly anyway tho. I'll add this to the next commit.

)

let goToApplePayPaymentAuthorization = pledgeAmountIsValid
.takeWhen(applePayButtonTappedAndOrIsChangingPaymentMethod)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically, I think we should just use .takeWhen(self.applePayButtonTappedSignal) here (and for the showApplePayAlert below

@scottkicks
Copy link
Contributor Author

Thanks @ifosli! I've thoroughly tested changing payment and the rest of the manage pledge flow on top of pledging. I like your suggestions and will get those in today and re-test 👍

@scottkicks scottkicks requested a review from ifosli June 27, 2024 18:15
@scottkicks scottkicks merged commit eb2e070 into main Jun 27, 2024
5 checks passed
@scottkicks scottkicks deleted the scott/debt/remove-risk-messaging branch June 27, 2024 19:06
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.

3 participants