Subscribe notify #1066
No reviewers
Labels
No labels
accessibility
app-parity
area: creator
area: daemon
area: design
area: devops
area: discovery
area: docs
area: installer
area: internal
area: livestream
area: performance
area: proposal
area: reposts
area: rewards
area: search
area: security
area: subscriptions
area: sync
area: ux
area: viewer
area: wallet
BEAMER
channel
comments
community PR
consider soon
core team
css
dependencies
electron
Epic
feature request
first-timers-only
good first issue
hacktoberfest
help wanted
hub-dependent
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
merge when green
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
notifications
odysee
on hold
playlists
priority: blocker
priority: high
priority: low
priority: medium
protocol dependent
recsys
redesign
regression
resilience
sdk dependent
Tom's Wishlist
trending
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbry-desktop#1066
Loading…
Reference in a new issue
No description provided.
Delete branch "subscribe-notify"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This notifies users whenever their is new content available for them on a channel they have subscribed to:
TODO: badges, I could add them into this PR, or maybe make a follow up
There are still a lot of codacity issues.
As discussed I think ideally we would notify after the file is downloaded, but this might be a good starting point. Another idea might just be to set a timeout before sending the notification, just to give a file a little more time to download. But to me that just seems like a hack to avoid notifying after the download is complete
@ -17,6 +17,7 @@ class FilePage extends React.PureComponent {
componentDidMount() {
this.fetchFileInfo(this.props);
this.fetchCostInfo(this.props);
this.checkSubscriptionLatest(this.props);
You can avoid a lot of unnecessary calls by only calling
checkSubscriptionLatest
if you are subscribed to that channelWhy do you need to pass in the new cost object. Shouldn't
doPurchaseUri
be able to select that data with the uri?@ -17,0 +90,4 @@
};
}
//$FlowIssue
I think this should have a case for
count === 1
, which is probably the most likely scenario. I think in that case just showing the title would make the most sense.Light feedback, did not run code
Can we wait to show this notification until after content is ready to watch? I.e. after
get
has successfully started? That way when the user clicks the notification they get something immediately.@ -17,0 +113,4 @@
false
) === uri
) {
dispatch(setSubscriptionLatest(channel, uri));
Is this function actually necessary? Could
doCheckSubscription
just callsetSubscriptionLatest
?@ -17,0 +90,4 @@
};
}
//$FlowIssue
it does, it just says
instead of, for example,
its is more efficient this way because I already have the cost information so we don't need to fetch it again and
@ -17,6 +17,7 @@ class FilePage extends React.PureComponent {
componentDidMount() {
this.fetchFileInfo(this.props);
this.fetchCostInfo(this.props);
this.checkSubscriptionLatest(this.props);
good call
@ -17,0 +113,4 @@
false
) === uri
) {
dispatch(setSubscriptionLatest(channel, uri));
check and set are different, set simply sets the value in the redux store. Check does an asynchronous call and sets the value accordingly by dispatching set, if that makes sense.
Yes, @seanyesmunt brought this up as well. I have reasons for why I didn't make it this way, which I think we should discuss -- although I think you are right that we probably want to download it first and I probably should have implemented it this way. I will schedule this in the next sprint.
I checked out the code here:
doLoadVideo
anddoPurchaseUri
are confusingly -- almost backwardly -- named. It may make sense to tweak these.doPurchaseUri
and go right todoLoadVideo
.doLoadVideo
anddoPurchaseUri
can trigger modal popups. It is weird that asynchronous background loading of content can trigger a modal. Fairly guaranteed that this will cause confusion at some point.get
. I think a light modification ofdoLoadVideo
to take a notification or callback would get you there.@ -17,0 +113,4 @@
false
) === uri
) {
dispatch(setSubscriptionLatest(channel, uri));
I'm asking two things in my question:
n
, is it actually necessary to check for the latest for this same information when accessing a file page?doCheckSubscription
a superset of the functionality provided bycheckSubscriptionLatest
? and why wouldn't you wantcheckSubscriptionLatest
to also begin downloads? Furthermore, why do both of these callLbry.claim_list_by_channel
when they could calldoFetchClaimsByChannel
instead?@ -17,0 +113,4 @@
false
) === uri
) {
dispatch(setSubscriptionLatest(channel, uri));
@liamcardenas did you see above?