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

Signing back in: fixes issues with outdated podcast information #1778

Merged
merged 7 commits into from
May 24, 2024

Conversation

leandroalonso
Copy link
Member

@leandroalonso leandroalonso commented May 22, 2024

Fixes #791 (comment)

We recently had an issue where a user had all their podcasts removed from folders when signing back in on another device.

This happened because they had outdated information and the app marked it as unsynced.

To test

With onlyMarkPodcastsUnsyncedForNewUsers enabled

  1. Go to Profile > Settings > Beta Features > enable onlyMarkPodcastsUnsyncedForNewUsers
  2. Sign in to a Plus account
  3. Create a folder with some podcasts in it and refresh
  4. Log out
  5. Go to Settings > Developer > Clear all folder information
  6. Subscribe to a few new podcasts
  7. Log back into the same account
  8. ✅ Under "Podcasts" the folder should be visible and with the same podcasts from before
  9. Go to Profile > Refresh Now
  10. ✅ Login into the web player, and ensure the newly subscribed podcasts were correctly synced

With onlyMarkPodcastsUnsyncedForNewUsers disabled

  1. Go to Profile > Settings > Beta Features > disable onlyMarkPodcastsUnsyncedForNewUsers
  2. Add a breakpoint in SyncSigninViewController.swift:337
  3. Sign in to a Plus account
  4. Create a folder with some podcasts in it and refresh
  5. Log out
  6. Go to Settings > Developer > Clear all folder information
  7. Log back into the same account
  8. ✅ Breakpoint should hit
  9. ✅ Under "Podcasts" the podcasts will be out of their folders

Checklist

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

@leandroalonso leandroalonso added [Type] Bug Used for issues where something is not functioning as intended. sync Issues related to sync between platforms labels May 22, 2024
@leandroalonso leandroalonso added this to the 7.65 milestone May 22, 2024
@leandroalonso leandroalonso requested a review from a team as a code owner May 22, 2024 20:09
@leandroalonso leandroalonso requested review from SergioEstevao and removed request for a team May 22, 2024 20:09
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is assigned to the milestone 7.65. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@@ -65,7 +65,9 @@ class AuthenticationHelper {
ServerSettings.refreshToken = response.refreshToken

// we've signed in, set all our existing podcasts to be non synced
DataManager.sharedManager.markAllPodcastsUnsynced()
if ServerSettings.lastSyncTime == nil {
DataManager.sharedManager.markAllPodcastsUnsynced()
Copy link
Member Author

Choose a reason for hiding this comment

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

@geekygecko Before merging this I'd like to double-check with you as I might be missing any user case.

The app will only mark all podcasts as unsynced if the user has never logged in to any account in this device.

Copy link
Member

Choose a reason for hiding this comment

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

If they have just signed in, the last sync should be nil already. 🤔
If they signed out for six months and subscribed to many podcasts, then signed in again, won't that mean those new podcasts won't appear on their other devices?

Copy link
Member Author

Choose a reason for hiding this comment

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

won't that mean those new podcasts won't appear on their other devices?

Based on my tests it syncs just fine (as per the PR description)

Copy link
Contributor

@SergioEstevao SergioEstevao left a comment

Choose a reason for hiding this comment

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

Code looks good and tested the scenario described and all worked correctly.

I do wonder why do we need to do step 4, Clear all folder information, the end user will not be able to do that, shouldn't this work correctly even without doing that?

@leandroalonso
Copy link
Member Author

I do wonder why do we need to do step 4, Clear all folder information, the end user will not be able to do that, shouldn't this work correctly even without doing that?

Very good question, @SergioEstevao. I should have been more explicit in the PR description.

if you test these same steps in trunk (including using the "Clear all folder information"), your podcasts will be out of their folders when you sign back.

This is to simulate the issue that happened that is reported in #791 (comment)

A user won't be able to do that, but in the past, we had a bug that caused this scenario. A user with an old device with this "wrong data" can end up with their podcasts out of their folders, which is exactly what happened for this user.

@leandroalonso
Copy link
Member Author

@SergioEstevao could you please review again? I added a feature flag so we can toggle this behavior in case it's needed.

Copy link
Contributor

@SergioEstevao SergioEstevao left a comment

Choose a reason for hiding this comment

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

All working great, and FF doing it's job!

@leandroalonso leandroalonso merged commit 30e526a into trunk May 24, 2024
4 checks passed
@leandroalonso leandroalonso deleted the fix/podcasts-out-folder-sign-in branch May 24, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sync Issues related to sync between platforms [Type] Bug Used for issues where something is not functioning as intended.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Podcasts being removed from folders
4 participants