-
Notifications
You must be signed in to change notification settings - Fork 139
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
Watch sync improvements #2425
Watch sync improvements #2425
Conversation
} | ||
|
||
let ids = episodes.map({"\($0.id)"}) | ||
try db.executeUpdate("UPDATE \(DataManager.episodeTableName) SET playingStatusModified = 0, playedUpToModified = 0, durationModified = 0, keepEpisodeModified = 0, archivedModified = 0 WHERE id IN (\(ids.joined(separator: ",")))", values: nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we feature flag this change? I know we've had performance issues with filters when doing queries with long lists so I don't know if that might be an issue here. Maybe less likely because those were issues on the main thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done here: c62407f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I played with few episodes and it seems to work. Restarting the app kept all the changes in place. I didn't notice any slow down for now but my db is not that big.
I left few comments
@@ -728,16 +728,15 @@ class EpisodeDataManager { | |||
} | |||
|
|||
func markAllSynced(episodes: [Episode], dbQueue: FMDatabaseQueue) { | |||
if episodes.count == 0 { return } | |||
guard !episodes.isEmpty else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe if episodes.isEmpty
is more clear than double negative
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done here: 4f456c8
} | ||
|
||
let ids = episodes.map({"\($0.id)"}) | ||
try db.executeUpdate("UPDATE \(DataManager.episodeTableName) SET playingStatusModified = 0, playedUpToModified = 0, durationModified = 0, keepEpisodeModified = 0, archivedModified = 0 WHERE id IN (\(ids.joined(separator: ",")))", values: nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
@danielebogo and @bjtitus ready for another look |
# Conflicts: # Modules/Utils/Sources/PocketCastsUtils/Feature Flags/FeatureFlag.swift
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 📘 Part of: # |
|:---:|
Fixes #
Optimize sync process to be faster and reduce the maximum number of episodes synced on a partial refresh.
To test
Checklist
CHANGELOG.md
if necessary.