Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(updatenotification): spread the use of new iappconfig #44165

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

ArtificialOwl
Copy link
Member

@ArtificialOwl ArtificialOwl commented Mar 12, 2024

This PR fix a regression from #43967 and #43454 where new appconfig's api were used to type values while the old API was still used in some other place

Context

It has been decided that once a config value is set as anything other than mixed (default type for config value pre-29) it cannot be set back to mixed.

Meaning that once IAppConfig::setValueString() have been called on a config key, any line of code using the old API to set a value for this config key would returns an exception like this one:

{
  "reqId": "aOMsS5ZTlMntl6lNG1g8",
  "level": 3,
  "time": "2024-03-12T15:34:05+00:00",
  "remoteAddr": "127.0.0.1",
  "user": "cult",
  "app": "index",
  "method": "GET",
  "url": "/index.php/settings/admin/overview",
  "message": "conflict between new type (mixed) and old type (integer)",
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0",
  "version": "29.0.0.7",
  "exception": {
    "Exception": "OCP\\Exceptions\\AppConfigTypeConflictException",
    "Message": "conflict between new type (mixed) and old type (integer)",
    "Code": 0,
    "Trace": [
      {
        "file": "/home/maxence/sites/nc29/nextcloud/lib/private/AppConfig.php",
        "line": 1340,
        "function": "setTypedValue",
        "class": "OC\\AppConfig",
        "type": "->"
      },
      {
        "file": "/home/maxence/sites/nc29/nextcloud/lib/private/AllConfig.php",
        "line": 208,
        "function": "setValue",
        "class": "OC\\AppConfig",
        "type": "->"
      },
      {
        "file": "/home/maxence/sites/nc29/nextcloud/lib/private/Updater/VersionCheck.php",
        "line": 65,
        "function": "setAppValue",
        "class": "OC\\AllConfig",
        "type": "->"
      },
      {
        "file": "/home/maxence/sites/nc29/nextcloud/apps/updatenotification/lib/UpdateChecker.php",
        "line": 52,
        "function": "check",
        "class": "OC\\Updater\\VersionCheck",
        "type": "->"
      },
      {
        "file": "/home/maxence/sites/nc29/nextcloud/apps/updatenotification/lib/Settings/Admin.php",
        "line": 95,
        "function": "getUpdateState",
        "class": "OCA\\UpdateNotification\\UpdateChecker",
        "type": "->"
      },
      {
        "file": "/home/maxence/sites/nc29/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php",
        "line": 129,
        "function": "getForm",
        "class": "OCA\\UpdateNotification\\Settings\\Admin",
        "type": "->"
      },
      {
        "file": "/home/maxence/sites/nc29/nextcloud/apps/settings/lib/Controller/AdminSettingsController.php",
        "line": 86,
        "function": "formatSettings",
        "class": "OCA\\Settings\\Controller\\AdminSettingsController",
        "type": "->"
      },
      {
        "file": "/home/maxence/sites/nc29/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php",
        "line": 149,
        "function": "getSettings",
        "class": "OCA\\Settings\\Controller\\AdminSettingsController",
        "type": "->"
      },
      {
        "file": "/home/maxence/sites/nc29/nextcloud/apps/settings/lib/Controller/AdminSettingsController.php",
        "line": 71,
        "function": "getIndexResponse",
        "class": "OCA\\Settings\\Controller\\AdminSettingsController",
        "type": "->"
      },
      {
        "file": "/home/maxence/sites/nc29/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 232,
        "function": "index",
        "class": "OCA\\Settings\\Controller\\AdminSettingsController",
        "type": "->"
      },
      {
        "file": "/home/maxence/sites/nc29/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 138,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/home/maxence/sites/nc29/nextcloud/lib/private/AppFramework/App.php",
        "line": 184,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/home/maxence/sites/nc29/nextcloud/lib/private/Route/Router.php",
        "line": 338,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/home/maxence/sites/nc29/nextcloud/lib/base.php",
        "line": 1050,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/home/maxence/sites/nc29/nextcloud/index.php",
        "line": 49,
        "function": "handleRequest",
        "class": "OC",
        "type": "::"
      }
    ],
    "File": "/home/maxence/sites/nc29/nextcloud/lib/private/AppConfig.php",
    "Line": 809,
    "message": "conflict between new type (mixed) and old type (integer)",
    "exception": {},
    "CustomMessage": "conflict between new type (mixed) and old type (integer)"
  }
}

@ArtificialOwl ArtificialOwl force-pushed the fix/noid/spread-appconfig-on-updatenotif1 branch from c0f0d85 to ffa611e Compare March 12, 2024 16:47
@susnux susnux added this to the Nextcloud 29 milestone Mar 12, 2024
@ArtificialOwl ArtificialOwl force-pushed the fix/noid/spread-appconfig-on-updatenotif1 branch 2 times, most recently from 3ef8856 to f3fb5ec Compare March 13, 2024 02:22
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
@ArtificialOwl ArtificialOwl force-pushed the fix/noid/spread-appconfig-on-updatenotif1 branch from f3fb5ec to 519e434 Compare March 13, 2024 03:22
@ArtificialOwl ArtificialOwl added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Mar 13, 2024
@susnux susnux merged commit 0ce35c7 into master Mar 13, 2024
160 checks passed
@susnux susnux deleted the fix/noid/spread-appconfig-on-updatenotif1 branch March 13, 2024 09:06
@Altahrim Altahrim mentioned this pull request Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants