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

AB testing: schedule a refresh based on TTL #15226

Merged
merged 7 commits into from
Nov 6, 2020

Conversation

leandroalonso
Copy link
Contributor

@leandroalonso leandroalonso commented Nov 5, 2020

Part of wordpress-mobile/WordPress-iOS-Shared#278

This PR:

  • Adds the feature to schedule a refresh given the tll that the ExPlat response returns
  • Uses URLSession instead of WordPressComRestApi
  • Has an object configuration, so it is completely decoupled from WPiOS

The latter two will help to extract it to https://github.com/Automattic/Automattic-Tracks-iOS

To test

Again, rely on the code/tests. :)

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@leandroalonso leandroalonso added this to the 16.2 milestone Nov 5, 2020
@leandroalonso leandroalonso self-assigned this Nov 5, 2020
@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Nov 5, 2020

You can trigger an installable build for these changes by visiting CircleCI here.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Nov 5, 2020

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

Copy link
Contributor

@emilylaguna emilylaguna left a comment

Choose a reason for hiding this comment

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

Seems good, left a concern about timers though.

return
}

self.scheduleTimer = Timer.scheduledTimer(withTimeInterval: self.ttl, repeats: true) { [weak self] timer in
Copy link
Contributor

Choose a reason for hiding this comment

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

I've had a lot of issues with timers in the past, I think you should invalidate and reset when the app goes to the background or comes to the foreground.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point!

Changed in 629db96

Copy link
Contributor

@emilylaguna emilylaguna left a comment

Choose a reason for hiding this comment

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

👍 🚢 Looks good to me.

@leandroalonso leandroalonso merged commit e2f10c1 into develop Nov 6, 2020
@leandroalonso leandroalonso deleted the issue/ab_testing_ttl branch November 6, 2020 12:39
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.

None yet

2 participants