Update module's 'fetch.' config vars can't be updated through the UI

Created on 21 July 2023, over 1 year ago
Updated 23 August 2024, 4 months ago

Problem/Motivation

The fetch config variables for the update module:

fetch:
  url: ''
  max_attempts: 2
  timeout: 30

are not editable through the Update Manager settings page (/admin/reports/updates/settings) or anywhere else? The only way to update them is by editing the update.settings.yml file itself. Is this a conscious choice? Were they editable and then removed, or have they been added and the form elements not added to the admin page?

If for any reason your update.settings.yml is deleted and you recreate it by going to the admin page, configuring the update settings and saving, the fetch part of the config settings are missing. This means in parts of the code that are expecting integers, nulls are used instead. This could in the future lead to unexpected behaviour. Such as the code trying to limit fetch attempts:

$max_fetch_attempts = $this->updateSettings->get('fetch.max_attempts');
...
if (empty($this->failed[$fetch_url_base]) || $this->failed[$fetch_url_base] < $max_fetch_attempts) {

Or the code trying to limit the fetch time while the cron is running:

  public function fetchData() {
    $end = time() + $this->updateSettings->get('fetch.timeout');
    if ($this->fetchQueue->numberOfItems()) {
      // Delete any stored project data as that needs refreshing when
      // update_calculate_project_data() is called.
      $this->tempStore->delete('update_project_data');
    }
    while (time() < $end && ($item = $this->fetchQueue->claimItem())) {
      $this->processFetchTask($item->data);
      $this->fetchQueue->deleteItem($item);
    }
  }
Feature request
Status

Needs work

Version

11.0 🔥

Component
Update 

Last updated 2 days ago

  • Maintained by
  • 🇺🇸United States @tedbow
  • 🇺🇸United States @dww
Created by

🇬🇧United Kingdom altcom_neil

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

Comments & Activities

Production build 0.71.5 2024