-
Notifications
You must be signed in to change notification settings - Fork 21
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
refactor(backend): throw exception instead of returning null #1133
Conversation
75675e9
to
1a442e6
Compare
1a442e6
to
911e6d5
Compare
this.sendingTip = false; | ||
if (e.code && e.code === 4) { | ||
} catch (error) { | ||
if (error.code && error.code === 4) { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why return without anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The author wanted to omit this kind of exceptions. It was introduced in 0b5506d I can't get what is supposed to fix, proposing to remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok :D good question
src/components/tipRecords/Author.vue
Outdated
@@ -48,8 +48,7 @@ export default { | |||
}, | |||
}, | |||
async mounted() { | |||
const profile = await Backend.getProfile(this.address); | |||
this.name = profile ? profile.preferredChainName : null; | |||
this.name = (await Backend.getProfile(this.address)).preferredChainName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can get the names from the names list in the store, the stored name for an account is also the preferredChainName, as the backend sorts them that way when they are globally fetched. This reduces the number of requests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have created #1134 to address this
@@ -108,7 +88,7 @@ export default class Backend { | |||
return backendFetch(`tips${query}`); | |||
}; | |||
|
|||
static addToken = async (address) => backendFetchNoTimeout('tokenCache/addToken', { | |||
static addToken = async (address) => backendFetch('tokenCache/addToken', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this request can take long, when it times out the user gets to see a non working version of word-bazaar, as his token is not indexed and cached properly yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, timeout in backendFetch
was removed in 22f0ee4
911e6d5
to
d77ddfd
Compare
4dfa640
to
74a4785
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trending - pass
Search - pass
Change profile pic- pass, but have to refresh a page to see results
Change back pic - pass
Change profile info - pass
Cookies - pass
Send Tip on the Feed - pass (with some issue)
Retip on the feed - pass (with some issue)
Post without tipping - pass
Add a comment - pass
Tip comment on the feed - pass (with some issue)
Pin/Unpin - pass
Claim - pass
Report post - pass
Voting - pass
Vote - pass
Revoke Vote - pass
Delegate voting power - pass
Create a new poll - pass
Search - pass
Meet - pass
Send a tip to user icon/comment - failed, the same on the product.
Updates - pass
Faq- pass
Change profile pic- pass, but have to refresh a page to see results:
Got this error when tried to send a tip on the feed (tip was sent):
Got this error when tried to retip content on the feed (retip was sent):
Got this error when tried to tip comment on the feed (tip was sent):
I accidentally put a space before a wallet address and got this:
The error sent tip in the Meet (the same on the product):
Remain:
Go back button affect the iframe wallet
Different names in Meet and wallet
74a4785
to
2aa659f
Compare
This one is fixed |
Cool! Please let me know if there is anything else to check. |
2aa659f
to
8449e46
Compare
@Liubov-crypto I've added a workaround for v1 tips/retips, please recheck errors from the last review. |
Retested, LGTM. Trending - pass |
adc5574
to
b95e11e
Compare
SSR will be deployed to superhero.aeternity.io, bundle report |
Known exceptions:
when opening details of word with a space in the name (aeternity/tipping-community-backend#368)
Chrome always report 404 even if they handled, we can't avoid it
I'm proposing a way how errors should be handled:
Later all not caught exceptions will show modal asking the user to report it. So we shouldn't have unhandled exceptions, at the same time we shouldn't handle them in a too general fashion (like I'm removing in this PR
.catch(() => null)
).How to test this PR:
fixes #707