Ensure claims are properly added to byId in redux #1710

Closed
opened 2018-06-28 07:39:25 +02:00 by neb-b · 2 comments
neb-b commented 2018-06-28 07:39:25 +02:00 (Migrated from github.com)

This discussion spawned from https://github.com/lbryio/lbry-app/pull/1652

The issue

At some points, data gets added to the byId key in redux. What is currently happening is that we populate byId in redux before populating the claims, which can cause issues. For example, on the subscriptions page, we should be able to take the channel claim id, and check it against the byId object in the claims reducer.

There are three scenarios:

  • Key exists and contains an array of claims
    • Already fetched, working good
  • Key exists and it is empty
    • Already fetched, no claims exist at this claim id (This is the bug, currently it can be empty even for channels that have content
  • Key does not exist
    • Not sure, fetch and find out

We noticed a bug where newly subscribed content wasn't being populated 100% of the time. We added a console error to log if a subscription has been populated in the byId map with no claims.

screen shot 2018-06-28 at 1 26 18 am
This discussion spawned from https://github.com/lbryio/lbry-app/pull/1652 ### The issue At some points, data gets added to the `byId` key in redux. What is currently happening is that we populate `byId` in redux before populating the claims, which can cause issues. For example, on the subscriptions page, we should be able to take the channel claim id, and check it against the `byId` object in the claims reducer. There are three scenarios: - Key exists and contains an array of claims - Already fetched, working good - Key exists and it is empty - Already fetched, no claims exist at this claim id (This is the bug, currently it can be empty even for channels that have content - Key does not exist - Not sure, fetch and find out We noticed a bug where newly subscribed content wasn't being populated 100% of the time. We added a console error to log if a subscription has been populated in the `byId` map with no claims. <img width="451" alt="screen shot 2018-06-28 at 1 26 18 am" src="https://user-images.githubusercontent.com/16882830/42014908-d35e7996-7a72-11e8-8dc3-e3a00b648fc5.png">
neb-b commented 2018-06-28 07:42:58 +02:00 (Migrated from github.com)

A good place to start would be to look at this file and check out any functions returning a new byId value.

If there is a key that we know has content, it shouldn't be added to that map unless it contains the channel claims.

A good place to start would be to look at [this file](https://github.com/lbryio/lbry-redux/blob/master/src/redux/reducers/claims.js) and check out any functions returning a new `byId` value. If there is a key that we know has content, it shouldn't be added to that map unless it contains the channel claims.
neb-b commented 2018-08-21 17:11:36 +02:00 (Migrated from github.com)

Now that we have an actual bug related to this I'm going to close this and keep that one open. #1884

Now that we have an actual bug related to this I'm going to close this and keep that one open. #1884
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#1710
No description provided.