pocket-casts-ios icon indicating copy to clipboard operation
pocket-casts-ios copied to clipboard

End of Year: refactor data source

Open leandroalonso opened this issue 2 years ago • 0 comments

📘 Project: #376

Refactor the data source to move data initialization to another entity and also add handling failure in the process:

Most of the changes are merely changes in the code though.

To test

Stories hasn't changed

  1. Enable the endOfYear flag in FeatureFlag.swift
  2. Run the app and make sure you're logged in to an account with a few items on Listening History
  3. When the prompt appears, tap "View My 2022"
  4. ✅ Check that the stories are presented correctly (there are no changes)

Forcing error

We might run into an error when loading stories. This is now handled, first, change EndOfYearStoriesDataSource.isReady() to just return false. Then:

  1. Run the app
  2. When the prompt appears, tap "View My 2022"
  3. ✅ Check that you see a "Failed to load stories" error

Checklist

  • [x] I have considered if this change warrants user-facing release notes and have added them to CHANGELOG.md if necessary.
  • [x] I have considered adding unit tests for my changes.
  • [x] I have updated (or requested that someone edit) the spreadsheet to reflect any new or changed analytics.

leandroalonso avatar Oct 21 '22 14:10 leandroalonso