Skip to content
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

Add method to check whether client .well-known has been fetched #1444

Merged
merged 3 commits into from
Aug 24, 2020

Conversation

jryans
Copy link
Collaborator

@jryans jryans commented Aug 19, 2020

This allows clearly detecting whether we have ever fetched .well-known at all.
Without this, it's hard to be sure whether the value is undefined because the
fetch has not been attempted yet or because an error occurred.

Part of element-hq/element-web#14954
Used by matrix-org/matrix-react-sdk#5130

This allows clearly detecting whether we have _ever_ fetched .well-known at all.
Without this, it's hard to be sure whether the value is `undefined` because the
fetch has not been attempted yet or because an error occurred.
Copy link
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I wonder if a method that returns a promise that resolves with the well known result or null once it's been fetched or failed to fetch, respectively, might be simpler?

This also seems fine though, although I would add a this._clientWellKnownFetchAttempted = false; to the constructor so it returns false rather than undefined (and maybe add similar for the other members too, eg. this._clientWellKnown, even though it's been baked into the API that it returns undefined rather than null...)

@jryans jryans requested a review from dbkr August 24, 2020 15:20
@jryans
Copy link
Collaborator Author

jryans commented Aug 24, 2020

@dbkr I have switched to a promise-based API, let me know how it looks now.

Copy link
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jryans jryans merged commit ed978f6 into develop Aug 24, 2020
@t3chguy t3chguy deleted the jryans/secure-backup-required branch May 10, 2022 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants