GoogleChrome / lighthouse-ci

Automate running Lighthouse for every commit, viewing the changes, and preventing regressions
Apache License 2.0
6.45k stars 651 forks source link

lighthouse-server - URLs missing from URL selection dropdown on comparison page #1082

Open daniel-arthur-sas opened 2 weeks ago

daniel-arthur-sas commented 2 weeks ago

Bug Description

Currently we are running lhci off of two URLs of the following format:

  1. http://example.com/app/index.html#/home
  2. http://example.com/app/index.html#/document/<document_id>

NOTE: I have made sure to add a urlReplacementPattern to account for differing document ids and can confirm that the <document_id> is being correctly replaced with a static placeholder. The issue im experiencing seems to be unrelated.

LHCI successfully generates reports for both URLs and uploads them to Lighthouse Server. However, when viewing the project dashboard, I am only presented with a single URL in the URL dropdown list of the report viewer. Opening the report for this URL appears to open a report for URL 2, meaning we can't access the report for URL 1.

The only available URL in the comparison page drop-down list is http://example.com/FooBar/index.html which does not match either URL 1 or 2. It would appear that the hash in the URL is causing this issue. Our web application uses hash-based routing and this is not something we will be able to change any time soon. It would appear that anything after the hash in the URL is omitted from the URL list that lighthouse-server's comparison page displays.

We have an additional admin application routed at /admin.html#/home and I can confirm that since the URL previous to the hash is different (admin.html vs index.html), lighthouse-server correctly shows the URL in the dropdown-list.

To Reproduce

Configure lighthouse-ci to collect and upload reports for two URLs that use hash-based routing e.g. /index.html#/foo and /index.html#/bar

Expected behavior

When I visit lighthouse-server, I should be able to see and select both URLS 1 and 2 in the available dropdown list of the report comparison page.

Environment: