-
-
Notifications
You must be signed in to change notification settings - Fork 522
refactor: make feed notifications more robust against subscription changes #7376
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
Conversation
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.
Using lastFeedWatchedTime will cause the all-caught-up marker to be moved.
From a UX perspective that would be unexpected, as the app would notify a user about new videos, but than not actually display them as new in the feed.
Not sure, if that is intended, but I think it would be better to use a separate variable to store the notification time.
Yes, I thought about this too, but forgot to write something about in in the PR description.
and I hesitated to add yet another one to prevent additional complexity. But yes, you're right, the way it's now with this PR doesn't make much sense. |
|
Maybe we could reuse Alternatively I think it is fine to add a new variable for this as
so the additional complexity is quite low. |
In theory yes, but I want to keep the implementation of the
Yes, that's probably the best solution. |
|
Not 100% happy with it yet, but at least it should work (although untested). |
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.
Just to confirm, we're no longer updating the LastFeedWatchedTime every time the feed is shown, but now only when the feed is fetched?
| // use the helper methods at PreferenceHelper to access these | ||
| const val LAST_USER_SEEN_FEED_TIME = "last_watched_feed_time" | ||
| const val LAST_REFRESHED_FEED_TIME = "last_updated_feed_time" |
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'm not super happy about a comment telling user not to use something and would prefer to encode this in the type-system, but that's unrelated to the PR.
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.
Yeah, me neither.
That usually should happen at the same time because we had only been updating the feed via the subscriptions fragment (and the home fragment, but I had a boolean for it to skip updating the variable then). I've pushed changes to clarify it, there are 3 places where we update any of these variables now:
|
|
I'll cleanup the commit history in a sec. |
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.
the refreshed time everytime the feed is loaded in the view model (which is also done by the home fragment)
I think it might be worthwhile discussing if changing that to avoid cases where the all-caught-up marker disappears (e.g. a users searches something, causing the fragment to reload, loosing the marker), but this isn't the right place for it.
closes #7366