Uh oh!
There was an error while loading. Please reload this page.
IUserConfig - #47658
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
6d81b97 to
a9e2a38CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
e9ec009 to
cda7029CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
1fbb6a9 to
317202aCompareUh oh!
There was an error while loading. Please reload this page.
c78f304 to
979eceeCompareUh oh!
There was an error while loading. Please reload this page.
979ecee to
41ba78fCompareUh oh!
There was an error while loading. Please reload this page.
8edb1c1 to
e510535CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
f71bb7d to
e24d29aCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
32c209d to
b80315bCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
b80315b to
0c489afCompareUh oh!
There was an error while loading. Please reload this page.
0c489af to
6ae7f9fCompareUh oh!
There was an error while loading. Please reload this page.
ceb814d to
a219133Compare| $value = $cache[$app][$key]; | ||
| try { | ||
| $this->decryptSensitiveValue($userId, $app, $key, $value); | ||
| $value = $this->convertTypedValue($value, $typedAs ?? $this->getValueType($userId, (string)$app, $key, $lazy)); |
Check failure
Code scanning / Psalm
RedundantCast
| * @param string $value preference value | ||
| * @param bool $caseInsensitive non-case-sensitive search, only works if $value is a string | ||
| * | ||
| * @return list<string> |
Check failure
Code scanning / Psalm
MoreSpecificReturnType
| * @since 31.0.0 | ||
| */ | ||
| public function searchUsersByValueString(string $app, string $key, string $value, bool $caseInsensitive = false): array { | ||
| return $this->searchUsersByTypedValue($app, $key, $value, $caseInsensitive); |
Check failure
Code scanning / Psalm
LessSpecificReturnStatement
| * @param string $key preference key | ||
| * @param array $values list of preference values | ||
| * | ||
| * @return list<string> |
Check failure
Code scanning / Psalm
MoreSpecificReturnType
| * @since 31.0.0 | ||
| */ | ||
| public function searchUsersByValues(string $app, string $key, array $values): array { | ||
| return $this->searchUsersByTypedValue($app, $key, $values); |
Check failure
Code scanning / Psalm
LessSpecificReturnStatement
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
97ab26e to
5b4f190Comparekesselb
commented
Nov 19, 2024
Please send a follow-up and increase the version to trigger the migration. |
st3iny
commented
Nov 19, 2024
An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'type' in 'field list' /home/richard/src/nextcloud/master/lib/private/DB/Exceptions/DbalException.php at 54 |
| * | ||
| * @throws \OCP\PreConditionNotMetException if a precondition is specified and is not met | ||
| * @throws \UnexpectedValueException when trying to store an unexpected value | ||
| * @deprecated 31.0.0 - use {@see IUserConfig} directly |
There was a problem hiding this comment.
https://docs.nextcloud.com/server/latest/developer_manual/digging_deeper/api.html#php-unstable-api
Code from the OCP namespace must never mention anything coming from the NCU namespace. It can not require it as an argument, constant or return something from NCU.
So you can not deprecate this and neither the public interface.
| * @param mixed $default the default value to be returned if the value isn't set | ||
| * | ||
| * @return string | ||
| * @deprecated 31.0.0 - use {@see IUserConfig} directly |
nickvergessen
commented
Nov 19, 2024
💥 This PR breaks talks tests. |
| string $userId, | ||
| string $app, | ||
| string $key, | ||
| string $default = '', |
There was a problem hiding this comment.
Breaking change, before mixed was documented and no type was casted.
At least null is used by apps and was used even in server's own method (setUserValue)
| string $key, | ||
| string $default = '', | ||
| ?bool $lazy = false, | ||
| ): string { |
There was a problem hiding this comment.
When the default value is "widen" again, the return type also needs to be
Please also document this |
| $userPreferences = \OCP\Server::get(IUserConfig::class); | ||
| if ($preCondition !== null) { | ||
| try { | ||
| if ($userPreferences->getValueMixed($userId, $appName, $key) !== (string)$preCondition) { |
There was a problem hiding this comment.
this is a behaviour change, previously the precondition did not fail, when the value is not set in the database.
| * SPDX-License-Identifier: AGPL-3.0-or-later | ||
| */ | ||
| namespace NCU\Config\Exceptions; |
There was a problem hiding this comment.
Please create a documentation for this new Namespace and the way it should work (when is it going to become stable, when can devs use it... etc)
There was a problem hiding this comment.
| // removing this index from Version13000Date20170718121200 | ||
| // $table->addIndex(['appid', 'configkey'], 'preferences_app_key'); | ||
| if ($table->hasIndex('preferences_app_key')) { | ||
| $table->dropIndex('preferences_app_key'); |
There was a problem hiding this comment.
for my dev instance running mariadb this DROP did not happen, so I now have redundant indexes:
The migration code seems correct, but something seems to prevent the DROP. @ArtificialOwl could you check the upgrade path?
There was a problem hiding this comment.
See #49638
The index is dropped... But next repair step run adds it again

IConfig's preferences-related method