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

Subscriptions overhaul #1872

Merged
merged 13 commits into from Aug 20, 2018

Conversation

Projects
None yet
5 participants
@daovist
Collaborator

daovist commented Aug 13, 2018

Epic #1861

  • show new/incoming content immediately on subscriptions page #1734
  • prevent window notification when viewing subscriptions page; show snackbar instead
  • add auto-download client setting; use as necessary #1114
  • increase SUBSCRIPTION_DOWNLOAD_LIMIT from 1 to 3 and apply limit to total downloads rather than per-channel*
  • automatically (attempt to) claim subscription reward after subbing to channel (fail silently) #1835
  • load subscription data on app startup #1852
  • auto-download on startup #1775
  • Do #1852 and #1775 correctly. My fix uses setTimeout which is a hack. We should be using redux-persist's <PersistGate> component/feature so actions are dispatched once redux has been rehydrated. This requires upgrading redux-persist from version 4.x to 5.x. There is a migration guide.
  • The last commit prevents downloading anything immediately following a user subscribing to a channel. This wasn't in any of the issues but it was very weird from a UX perspective to auto-download multiple videos upon subscribing. It still sets latest so it will work like other subscription from then on.

*As it was, the app would download the limit (1) for each channel which could be too much if a user is subscribed to many channels. One issue with this approach is that it will dispatch downloads in the order it iterates through subscriptions. To fix that would require calling all the endpoints, flattening the data, and choosing which ones to download. I found this to be a reasonable compromise for when a user opens the app and may have lots of new content available. Any new content that is prevented from downloading this way still creates a NOTIFY_ONLY notification, adding to the badge count next to Subscriptions. We may want to allow a user to determine the value of SUBSCRIPTION_DOWNLOAD_LIMIT.

@daovist

This comment has been minimized.

Show comment
Hide comment
@daovist

daovist Aug 13, 2018

Collaborator

One weird thing about this @seanyesmunt

I'm using the existing reducer FETCH_CHANNEL_CLAIMS_COMPLETED to update the claim info so it will show on the subscriptions page; the lack of doing so was causing the main quirk in all this #1734 . I am not using FETCH_CHANNEL_CLAIMS_STARTED because that prevented the subscriptions page from even loading. The code I started with dispatched CHECK_SUBSCRIPTION_STARTED and CHECK_SUBSCRIPTION_COMPLETED which had no reducers and thus did nothing.

Collaborator

daovist commented Aug 13, 2018

One weird thing about this @seanyesmunt

I'm using the existing reducer FETCH_CHANNEL_CLAIMS_COMPLETED to update the claim info so it will show on the subscriptions page; the lack of doing so was causing the main quirk in all this #1734 . I am not using FETCH_CHANNEL_CLAIMS_STARTED because that prevented the subscriptions page from even loading. The code I started with dispatched CHECK_SUBSCRIPTION_STARTED and CHECK_SUBSCRIPTION_COMPLETED which had no reducers and thus did nothing.

@seanyesmunt seanyesmunt requested a review from skhameneh Aug 13, 2018

@lbry-bot lbry-bot assigned skhameneh and seanyesmunt and unassigned seanyesmunt Aug 13, 2018

@seanyesmunt

A few minor comments but looks good. Will need to do some testing before merging.

Show outdated Hide outdated src/renderer/page/settings/view.jsx
Show outdated Hide outdated src/renderer/redux/actions/content.js
Show outdated Hide outdated src/renderer/redux/reducers/settings.js
@seanyesmunt

This comment has been minimized.

Show comment
Hide comment
@seanyesmunt

seanyesmunt Aug 15, 2018

Member

Found one issue (still testing).

I subscribed to a channel
Started downloading the first video
Saw a badge of (9) in the side bar
Finished downloading
Badge chagned to (10)

Member

seanyesmunt commented Aug 15, 2018

Found one issue (still testing).

I subscribed to a channel
Started downloading the first video
Saw a badge of (9) in the side bar
Finished downloading
Badge chagned to (10)

@seanyesmunt

This comment has been minimized.

Show comment
Hide comment
@seanyesmunt

seanyesmunt Aug 15, 2018

Member

Possibly we should look at the date you subscribed to a channel, and if it is newer than that, then show the notification/download? Not sure.

Member

seanyesmunt commented Aug 15, 2018

Possibly we should look at the date you subscribed to a channel, and if it is newer than that, then show the notification/download? Not sure.

@daovist

This comment has been minimized.

Show comment
Hide comment
@daovist

daovist Aug 15, 2018

Collaborator

The badge 9/10 thing is because of how that number is calculated. It's the count of all notifications that are not DOWNLOADING, so just NOTIFY_ONLY and DOWNLOADED. I think counting downloading files as notifications seems like a good fix.

Collaborator

daovist commented Aug 15, 2018

The badge 9/10 thing is because of how that number is calculated. It's the count of all notifications that are not DOWNLOADING, so just NOTIFY_ONLY and DOWNLOADED. I think counting downloading files as notifications seems like a good fix.

@seanyesmunt

This comment has been minimized.

Show comment
Hide comment
@seanyesmunt

seanyesmunt Aug 15, 2018

Member

I think that number is ok, but it should only show the badge if it's actually new content, not just the first page of content on an old channel that I subscribed to.

In this case:

I subscribe to a channel
Close the app
Channel uploads 10 files
Open the app
See notification with (10)

Member

seanyesmunt commented Aug 15, 2018

I think that number is ok, but it should only show the badge if it's actually new content, not just the first page of content on an old channel that I subscribed to.

In this case:

I subscribe to a channel
Close the app
Channel uploads 10 files
Open the app
See notification with (10)

@tzarebczan

This comment has been minimized.

Show comment
Hide comment
@tzarebczan

tzarebczan Aug 16, 2018

Member

@seanyesmunt and I also discussed exposing the autodownload setting on the sub page too.

Is autodownload on startup supposed to work with the hack? When I go into a claim I'm subbed to (and not downloaded), I see it starting to download automatically - is this intentional?

We should incorporate the download limit as a setting if we are going to impose it. I think it would also work better as a per channel instead of across all subs setting.

Member

tzarebczan commented Aug 16, 2018

@seanyesmunt and I also discussed exposing the autodownload setting on the sub page too.

Is autodownload on startup supposed to work with the hack? When I go into a claim I'm subbed to (and not downloaded), I see it starting to download automatically - is this intentional?

We should incorporate the download limit as a setting if we are going to impose it. I think it would also work better as a per channel instead of across all subs setting.

@kauffj

This comment has been minimized.

Show comment
Hide comment
@kauffj

kauffj Aug 16, 2018

Member

Encountered this error running this branch:

subscriptions.js?421d:133 Uncaught ReferenceError: savedSubscription is not defined
    at eval (subscriptions.js?421d:133)
    at /home/kauffj/code/lbry-app/node_modules/redux-thunk/lib/index.js:11
    at dispatch (/home/kauffj/code/lbry-app/node_modules/redux/lib/applyMiddleware.js:45)
    at eval (subscriptions.js?421d:273)
    at Array.forEach (<anonymous>)
    at eval (subscriptions.js?421d:272)
    at /home/kauffj/code/lbry-app/node_modules/redux-thunk/lib/index.js:11
    at dispatch (/home/kauffj/code/lbry-app/node_modules/redux/lib/applyMiddleware.js:45)
    at eval (subscriptions.js?421d:282)
Member

kauffj commented Aug 16, 2018

Encountered this error running this branch:

subscriptions.js?421d:133 Uncaught ReferenceError: savedSubscription is not defined
    at eval (subscriptions.js?421d:133)
    at /home/kauffj/code/lbry-app/node_modules/redux-thunk/lib/index.js:11
    at dispatch (/home/kauffj/code/lbry-app/node_modules/redux/lib/applyMiddleware.js:45)
    at eval (subscriptions.js?421d:273)
    at Array.forEach (<anonymous>)
    at eval (subscriptions.js?421d:272)
    at /home/kauffj/code/lbry-app/node_modules/redux-thunk/lib/index.js:11
    at dispatch (/home/kauffj/code/lbry-app/node_modules/redux/lib/applyMiddleware.js:45)
    at eval (subscriptions.js?421d:282)

@seanyesmunt seanyesmunt merged commit a5bc6ad into master Aug 20, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@seanyesmunt seanyesmunt deleted the subscriptions-overhaul branch Sep 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment