From f245f09d1c331cfe1340ef9d2c275bcf04f0ed4d Mon Sep 17 00:00:00 2001 From: infinite-persistence <64950861+infinite-persistence@users.noreply.github.com> Date: Thu, 19 May 2022 08:37:53 +0800 Subject: [PATCH] Revert "Temporarily prevent invalid `get` calls until we figure it out" (#1529) This reverts commit f6f15531d48991b554cd65a0ec6759923b9e264f. The root-cause was known (8dd0982f), and I don't think it worked because: 1. The issue happened at the web side which didn't have logging. 2. The `[object Promise]` came after the `get`, not before. --- ui/lbry.js | 13 +------------ web/lbry.js | 10 +--------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/ui/lbry.js b/ui/lbry.js index fff9c0100..b6130bace 100644 --- a/ui/lbry.js +++ b/ui/lbry.js @@ -80,18 +80,7 @@ const Lbry = { // Claim fetching and manipulation resolve: (params) => daemonCallWithResult('resolve', params, searchRequiresAuth), - // get: (params) => daemonCallWithResult('get', params), - get: (params) => { - // $FlowFixMe - const uri = params?.uri; - if (uri && uri.endsWith('[object Promise]')) { - try { - analytics.error(`get: Invalid url (${uri})\n\`\`\`${new Error().stack}\`\`\``); - } catch {} - return Promise.reject(new Error(`get: Invalid url (${uri})`)); - } - return daemonCallWithResult('get', params); - }, + get: (params) => daemonCallWithResult('get', params), claim_search: (params) => daemonCallWithResult('claim_search', params, searchRequiresAuth), claim_list: (params) => daemonCallWithResult('claim_list', params), channel_create: (params) => daemonCallWithResult('channel_create', params), diff --git a/web/lbry.js b/web/lbry.js index ed1cd5345..16059abf4 100644 --- a/web/lbry.js +++ b/web/lbry.js @@ -76,15 +76,7 @@ const Lbry = { // Claim fetching and manipulation resolve: (params) => daemonCallWithResult('resolve', params), - // get: (params) => daemonCallWithResult('get', params), - get: (params) => { - // $FlowFixMe - const uri = params?.uri; - if (uri && uri.endsWith('[object Promise]')) { - return Promise.reject(new Error(`get: Invalid url (${uri})`)); - } - return daemonCallWithResult('get', params); - }, + get: (params) => daemonCallWithResult('get', params), claim_search: (params) => daemonCallWithResult('claim_search', params), claim_list: (params) => daemonCallWithResult('claim_list', params), channel_create: (params) => daemonCallWithResult('channel_create', params),