Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/private/Config/UserConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,10 @@ private function setTypedValue(
}

$oldValue = null;
$updateReason = '';
if ($this->hasKey($userId, $app, $key, $lazy)) {
$updateReason = 'key exists';

/**
* no update if key is already known with set lazy status and value is
* not different, unless sensitivity is switched from false to true.
Expand Down Expand Up @@ -1206,6 +1209,7 @@ private function setTypedValue(
// TODO: throw exception or just log and returns false !?
throw $e;
}
$updateReason = 'insert raised a duplicate contraint';
}
}

Expand All @@ -1216,7 +1220,11 @@ private function setTypedValue(
$currType = $this->valueDetails[$userId][$app][$key]['type'] ?? null;
if ($currType === null) { // this might happen when switching lazy loading status
$this->loadConfigAll($userId);
$currType = $this->valueDetails[$userId][$app][$key]['type'];

if (!isset($this->valueDetails[$userId][$app][$key])) {
throw new UnknownKeyException("unknown key $app $key for $userId even though $updateReason");
}
$currType = $this->valueDetails[$userId][$app][$key]['type'] ?? null;
}

/**
Expand Down
Loading