Refactor homeserver lookup code #12
No reviewers
Labels
No labels
bug
discussion
duplicate
enhancement
help wanted
invalid
question
suggestion
tracker
ui/ux
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: cadence/Carbon#12
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor-homeserver-lookup"
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?
I find this much cleaner and more readable, but I'm bad, so code review from someone better and this please?
@ -139,0 +138,4 @@
} catch(e) {}
// Find the next matrix server in the chain
const root = await fetch(`${address}/.well-known/matrix/client`).then(res => res.json()).catch(e => {
Why chain a promise catch here? I don't have a problem with promise chaining, it's just weird considering that we used the try/catch syntax 3 lines up. IMO they should be made consistent?
It was shorter. I actually wanted to write the code like it's written now but jshint errored on the optional chain. It's fixed now