镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
Merged
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 @@ -1141,7 +1141,10 @@ private function setTypedValue(
}
}

$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 @@ -1175,6 +1178,7 @@ private function setTypedValue(
// TODO: throw exception or just log and returns false !?
throw $e;
}
$updateReason = 'insert raised a duplicate contraint';
}
}

Expand All @@ -1185,7 +1189,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