satis icon indicating copy to clipboard operation
satis copied to clipboard

Keyword search fails in web view if any repository lacks the `keywords` field

Open ngmy opened this issue 6 months ago • 0 comments

Describe the bug In the repositories field of satis.json, if the set includes even a single repository whose composer.json lacks the keywords field, the keyword search in the web view does not work. This prevents filtering repositories by keyword correctly.

To Reproduce

  1. Run satis build as Docker container. satis.json:
    {
        "name": "<my-org>/<my-repo>",
        "homepage": "http://<my-satis-server-url>",
        "output-dir": "public",
        "repositories": [
            {
                "type": "vcs",
                "url": "https://github.com/<my-org>/<my-repo-with-keywords-field>"
            },
            {
                "type": "vcs",
                "url": "https://github.com/<my-org>/<my-repo-without-keywords-field>"
            }
        ],
        "archive": {
            "directory": "dist"
        },
        "require-all": true
    }
    
  2. Open a web view and search by keyword. Image

Outcome JavaScript error occurring during keyword search in web view:

index.html:387 Uncaught TypeError: Cannot read properties of null (reading 'textContent')
    at index.html:387:16187
    at Array.forEach (<anonymous>)
    at t.value (index.html:387:16063)
(anonymous) @ index.html:387
value @ index.html:387
setTimeout
(anonymous) @ index.html:387

Expected behavior We expect the keyword search to ignore repositories that are missing the keywords field and filter only based on the keywords of repositories that have the field.

Additional context Browser: Google Chrome 139.0.7258.128

ngmy avatar Aug 25 '25 13:08 ngmy