filter claims by bid_state: 'Controlling' #638

Merged
daovist merged 2 commits from controlling-claims-only into master 2018-10-23 00:15:45 +02:00
daovist commented 2018-10-18 18:30:11 +02:00 (Migrated from github.com)
No description provided.
skhameneh (Migrated from github.com) requested changes 2018-10-18 23:07:55 +02:00
@ -63,19 +63,22 @@ export default (db, table, sequelize) => ({
});
},
skhameneh (Migrated from github.com) commented 2018-10-18 23:07:09 +02:00

Do something like:
getAllChannelClaims: async (channelClaimId, bidState = 'Controlling') => {

where: bidState === false ? { publisher_id: channelClaimId } : { publisher_id: channelClaimId, bid_state: bidState },

Do something like: ```getAllChannelClaims: async (channelClaimId, bidState = 'Controlling') => {``` ```where: bidState === false ? { publisher_id: channelClaimId } : { publisher_id: channelClaimId, bid_state: bidState },```
skhameneh (Migrated from github.com) reviewed 2018-10-18 23:08:36 +02:00
@ -63,19 +63,22 @@ export default (db, table, sequelize) => ({
});
},
skhameneh (Migrated from github.com) commented 2018-10-18 23:08:36 +02:00

This way all can be easily queried by disabling the default filter

This way all can be easily queried by disabling the default filter
skhameneh (Migrated from github.com) approved these changes 2018-10-23 00:15:33 +02:00
tzarebczan (Migrated from github.com) reviewed 2018-10-30 00:55:44 +01:00
@ -65,3 +65,3 @@
getAllChannelClaims: async (channelClaimId) => {
getAllChannelClaims: async (channelClaimId, bidState = 'Controlling') => {
logger.debug(`claim.getAllChannelClaims for ${channelClaimId}`);
tzarebczan (Migrated from github.com) commented 2018-10-30 00:55:44 +01:00

actually, I think this should be either Controlling or Active.

actually, I think this should be either Controlling or Active.
tzarebczan (Migrated from github.com) reviewed 2018-10-30 00:56:22 +01:00
@ -65,3 +65,3 @@
getAllChannelClaims: async (channelClaimId) => {
getAllChannelClaims: async (channelClaimId, bidState = 'Controlling') => {
logger.debug(`claim.getAllChannelClaims for ${channelClaimId}`);
tzarebczan (Migrated from github.com) commented 2018-10-30 00:56:22 +01:00

@tiger5226 can you confirm?

@tiger5226 can you confirm?
tiger5226 (Migrated from github.com) reviewed 2018-10-30 01:06:44 +01:00
@ -65,3 +65,3 @@
getAllChannelClaims: async (channelClaimId) => {
getAllChannelClaims: async (channelClaimId, bidState = 'Controlling') => {
logger.debug(`claim.getAllChannelClaims for ${channelClaimId}`);
tiger5226 (Migrated from github.com) commented 2018-10-30 01:06:43 +01:00

Well they are different bid states. Controlling means the claim has won the bid for that name, while Active means it has lost. So the question is do they want all claims, regardless of bid state? Then yes, both should be considered. There is also Accepted, Spent too.

Well they are different bid states. `Controlling` means the claim has won the bid for that name, while `Active` means it has lost. So the question is do they want all claims, regardless of bid state? Then yes, both should be considered. There is also `Accepted`, `Spent` too.
tzarebczan (Migrated from github.com) reviewed 2018-10-30 02:51:16 +01:00
@ -65,3 +65,3 @@
getAllChannelClaims: async (channelClaimId) => {
getAllChannelClaims: async (channelClaimId, bidState = 'Controlling') => {
logger.debug(`claim.getAllChannelClaims for ${channelClaimId}`);
tzarebczan (Migrated from github.com) commented 2018-10-30 02:51:16 +01:00

I didn't look at the overall code, but judging by the variable name it's looking it up by the claim ID, and not the claim name... So I don't see why we'd want only controlling claims.

I didn't look at the overall code, but judging by the variable name it's looking it up by the claim ID, and not the claim name... So I don't see why we'd want only controlling claims.
tiger5226 (Migrated from github.com) reviewed 2018-10-31 02:19:20 +01:00
@ -65,3 +65,3 @@
getAllChannelClaims: async (channelClaimId) => {
getAllChannelClaims: async (channelClaimId, bidState = 'Controlling') => {
logger.debug(`claim.getAllChannelClaims for ${channelClaimId}`);
tiger5226 (Migrated from github.com) commented 2018-10-31 02:19:20 +01:00

that's a good point. Basically it will return null if it is not controlling. Seems like this check should be somewhere else more descriptive.

that's a good point. Basically it will return null if it is not controlling. Seems like this check should be somewhere else more descriptive.
daovist (Migrated from github.com) reviewed 2018-10-31 13:41:28 +01:00
@ -65,3 +65,3 @@
getAllChannelClaims: async (channelClaimId) => {
getAllChannelClaims: async (channelClaimId, bidState = 'Controlling') => {
logger.debug(`claim.getAllChannelClaims for ${channelClaimId}`);
daovist (Migrated from github.com) commented 2018-10-31 13:41:28 +01:00

As of #668 it's getting Controlling, Active, and Accepted:

    const whereClause = bidState || {
      [sequelize.Op.or]: [
        { bid_state: 'Controlling' },
        { bid_state: 'Active' },
        { bid_state: 'Accepted' },
      ],
    };
As of #668 it's getting Controlling, Active, and Accepted: ``` const whereClause = bidState || { [sequelize.Op.or]: [ { bid_state: 'Controlling' }, { bid_state: 'Active' }, { bid_state: 'Accepted' }, ], }; ```
Sign in to join this conversation.
No reviewers
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/spee.ch#638
No description provided.