Skip to content

Properly handle unresolvable shortname edge cases#2065

Merged
deniak merged 2 commits intomainfrom
kgf-shortname-fixes
Mar 23, 2026
Merged

Properly handle unresolvable shortname edge cases#2065
deniak merged 2 commits intomainfrom
kgf-shortname-fixes

Conversation

@kfranqueiro
Copy link
Copy Markdown
Contributor

This resolves potential for server crashes when no suitable link is found in the value for "This version" under "More details about this document". There are 2 commits initially in the PR, one resolving an edge case for the validate API, the other for the metadata API.

Changes in addition to the fixes themselves:

  • Adds a generic.shortname.not-found l10n string to be used by the if (!shortname) code path in Specberus#getPreviousVersion in validator.js
  • Adds tests/docs/failures/2021-wd-no-this-link.html, largely based on tests/docs/2021-wd.html with the removal of the href attribute from the a tag under the This Version dd
  • Adds expectMetadataFailure function to test/rules.js and uses it when iterating new failures array within Basics tests (as it seems we were never testing any failure edge cases for the metadata API)

@kfranqueiro kfranqueiro requested a review from deniak March 16, 2026 15:04
Comment thread test/rules.js
@deniak deniak merged commit 72caae4 into main Mar 23, 2026
10 checks passed
@deniak deniak deleted the kgf-shortname-fixes branch March 23, 2026 06:31
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