fix(endpoint-webmention-io): cope with authors without a photo or a valid URL - #935
Merged
Merged
Conversation
…alid URL The list rendered an empty avatar for an author with no photo, and threw when an author URL didn’t parse even though a name was given. Also time out the webmention.io request after 15 seconds. Fixes #934
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #934.
avataris only set when the author has aphoto; the fixture author has none, and the list rendered<img class="avatar" src="">for it.getAuthorNamereturnsauthor.namebefore touching the URL, and returns the raw value when it doesn’t parse, instead of throwingTypeError: Invalid URL.AbortSignal.timeout(15_000); a timeout reaches the error handler like any other fetch failure.img.avatar(fails onmain: 1); two unit cases for non-URL author values (fail onmainwithInvalid URL).Verified locally:
node --test packages/endpoint-webmention-io/test/**/*.js16/16, eslint and prettier clean.