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

Settings Sync: Fix Up Next settings #1615

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from

Conversation

bjtitus
Copy link
Contributor

@bjtitus bjtitus commented Apr 12, 2024

Fixes a minor issue when importing the Up Next setting. Previously this passed through the new update mechanism which would set the ModifiedDate to the current date, so this setting would be overwritten by the last device to import, which was not the original guidelines. We want any imported values to be assigned an epoch date (done in #1616), not the current date, so they are clearly delineated from changed settings.

To test

  • Change the return value of shouldEnableSyncedSettings in FeatureFlag.swift to false
  • Subscribe to a podcast
  • Enable "Add to Up Next" in the Podcast settings
  • Enable the newSettingsStorage and settingsSync feature flags
  • Restart the app
  • Ensure your "Add to Up Next" setting remains the same

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.

@bjtitus bjtitus added the settings Issues related to user or podcast settings label Apr 12, 2024
@dangermattic
Copy link
Collaborator

dangermattic commented Apr 12, 2024

1 Warning
⚠️ This PR is assigned to the milestone 7.63. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by 🚫 Danger

@bjtitus bjtitus force-pushed the bjtitus/settings-sync/up-next-setting branch 2 times, most recently from 5635445 to ab00f17 Compare April 12, 2024 02:33
@bjtitus bjtitus added this to the 7.62 milestone Apr 12, 2024
@bjtitus bjtitus marked this pull request as ready for review April 12, 2024 02:59
@bjtitus bjtitus requested a review from a team as a code owner April 12, 2024 02:59
@bjtitus bjtitus requested review from leandroalonso and removed request for a team April 12, 2024 02:59
@bjtitus bjtitus changed the title Fix Up Next settings Settings Sync: Fix Up Next settings Apr 12, 2024
Copy link
Member

@leandroalonso leandroalonso left a comment

Choose a reason for hiding this comment

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

@bjtitus this seems to not be working for me:

not_working_1080.mov

If I change the flag to false, the correct values return.

addToUpNext = false
addToUpNext = newValue.enabled
if let position = newValue.position {
addToUpNextPosition = position
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if it matters, but shouldn't addToUpNextPosition be optional? In case it has no position, is nil.

As it stands it will be the previous value that had a position.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It can't be optional in the Protobuf settings so I was thinking we shouldn't make it optional in our local model.

Comment on lines 25 to 29
var enabled: Bool {
get {
return self != .off
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
var enabled: Bool {
get {
return self != .off
}
}
var enabled: Bool {
self != .off
}

@bjtitus bjtitus force-pushed the bjtitus/settings-sync/up-next-setting branch from 577c6cc to 47487ee Compare April 12, 2024 20:17
@SergioEstevao SergioEstevao modified the milestones: 7.62, 7.63 Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
settings Issues related to user or podcast settings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants