Project detail page is throwing an exception

Created on 19 June 2024, 9 days ago

I have not identified a clear pattern yet but the /admin/modules/browse/{module_name} route is throwing the following exception:

ModulePage.svelte:102 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'title')
    at create_fragment$1 (ModulePage.svelte:102:48)
    at init (index.mjs:1891:37)
    at new ModulePage (ModulePage.svelte:55:59)
    at Array.create_if_block_2 (App.svelte:53:23)
    at create_then_block (App.svelte:53:23)
    at update (index.mjs:1385:51)
    at index.mjs:1420:13

The mocked Drupal.org source is working as expected if it is the only source. But if I enable the Recipes source (for example) and I try to access one project detail page, I face the exception.

Steps to reproduce:

  • Enable project browser
  • Enable Drupal (mocked) and Recipes sources
  • On project browser page, click any project listed by Drupal (mocked)
πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡«πŸ‡·France vbouchet

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @vbouchet
  • πŸ‡«πŸ‡·France vbouchet

    As per my investigation, this is because the Recipes source is not updating the number of result.

    Object.entries(data).forEach((item) => {
      const [source, result] = item;
      if (result.totalResults !== 0) {
        $activeTab = source;
        [project] = result.list;
        projectExists = true;
      }
    });
    

    The JS behind /admin/modules/browse/{module_name} still invokes all the source plugins but expect only one source to return results.

    Globally, I think the JS should be aware of the active source tab so other sources can act appropriately:
    - In case it is the /browser, run a lightweight query as the goal is only to know the number of projects matching the criteria.
    - In case it is the /browser/{project_name}, don't do anything

  • Status changed to Needs review 9 days ago
  • πŸ‡«πŸ‡·France vbouchet

    The suggested commit is not reworking the global implementation, just fixing the way total is counted in the Recipe sources so it does count only after filtering is applied.

  • Pipeline finished with Success
    9 days ago
    Total: 932s
    #202980
Production build 0.69.0 2024