Skip to content

User/kendzisah/fix manifest analyzer validation#5176

Merged
JudahGabriel merged 7 commits into
mainfrom
user/kendzisah/fix-manifest-analyzer-validation
Oct 23, 2025
Merged

User/kendzisah/fix manifest analyzer validation#5176
JudahGabriel merged 7 commits into
mainfrom
user/kendzisah/fix-manifest-analyzer-validation

Conversation

@kendzisah10
Copy link
Copy Markdown
Contributor

@kendzisah10 kendzisah10 commented Oct 17, 2025

fixes #[issue number]
#5119

PR Type

  • Bugfix

Describe the current behavior?

Previous Behavior and Bug

The Problem: PWABuilder's manifest analysis was insufficient, allowing invalid manifests to pass validation and subsequently fail during packaging. Specifically:

  • Missing image validation: Existing CheckImagesAreFetchable method existed but wasn't comprehensive enough
  • No type consistency checking: Existing type check wasn't truly checking the type of the image- only checking if the image had a type specified.
  • No size validation: Didn't correctly validate all sizes.

Describe the new behavior?

The Solution: Implemented comprehensive image validation with multiple new capability checks:

  • Enhanced type validation
  • New size validation
  • Improved type consistency
  • Fixed Early Error Detection so errors are caught before packaging.

PR Checklist

  • Test: run npm run test and ensure that all tests pass
  • Target main branch (or an appropriate release branch if appropriate for a bug fix)
  • Ensure that your contribution follows standard accessibility guidelines. Use tools like https://webhint.io/ to validate your changes.

Additional Information

Copilot AI review requested due to automatic review settings October 17, 2025 00:26
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances PWABuilder's manifest validation by implementing comprehensive image validation for icons and screenshots. The changes address a critical gap where invalid manifests were passing validation and subsequently failing during packaging.

  • Added new capability checks for validating icon and screenshot types match their actual file types
  • Added new capability checks for validating declared sizes match actual image dimensions
  • Enhanced existing icon type checking logic to validate both declared types and file extensions consistently

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
ManifestAnalyzer.cs Added new capability checks and improved icon type validation logic
ImageValidationService.cs Added new validation methods for image types and dimensions using ImageSharp
PwaCapabilityId.cs Added enum values for the new validation capabilities
PwaCapability.cs Added capability definitions for the new validation checks

Comment thread apps/pwabuilder/Services/ManifestAnalyzer.cs
Comment thread apps/pwabuilder/Services/ImageValidationService.cs Outdated
Comment thread apps/pwabuilder/Services/ImageValidationService.cs Outdated
Comment thread apps/pwabuilder/Services/ImageValidationService.cs Outdated
@kendzisah10
Copy link
Copy Markdown
Contributor Author

Screenshot of the analyzer in effect:
image

@JudahGabriel JudahGabriel added this pull request to the merge queue Oct 23, 2025
Merged via the queue into main with commit f07ed34 Oct 23, 2025
5 of 6 checks passed
@JudahGabriel JudahGabriel deleted the user/kendzisah/fix-manifest-analyzer-validation branch October 23, 2025 01:26
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.

4 participants