(fix): missing users case

This commit is contained in:
Jake Barnby
2026-04-01 14:07:59 +13:00
parent 142e671c7d
commit 829cf887dc
3 changed files with 33 additions and 5 deletions
+14
View File
@@ -187,6 +187,20 @@ class V24 extends Migration
$this->dbForProject->purgeCachedCollection($id);
break;
case 'users':
try {
$this->createAttributeFromCollection($this->dbForProject, $id, 'impersonator');
} catch (Throwable $th) {
Console::warning("Failed to create attribute \"impersonator\" in collection {$id}: {$th->getMessage()}");
}
try {
$this->createIndexFromCollection($this->dbForProject, $id, 'impersonator');
} catch (Throwable $th) {
Console::warning("Failed to create index \"impersonator\" from {$id}: {$th->getMessage()}");
}
$this->dbForProject->purgeCachedCollection($id);
break;
case 'teams':
try {
$this->createAttributeFromCollection($this->dbForProject, $id, 'labels');
+1 -1
View File
@@ -1343,7 +1343,7 @@ class Install extends Action
{
$argv = $_SERVER['argv'] ?? [];
foreach ($argv as $arg) {
if (\str_starts_with($arg, '--') && !\str_starts_with($arg, '--interactive')) {
if (\str_starts_with($arg, '--')) {
return true;
}
}
+18 -4
View File
@@ -11,34 +11,48 @@ class V21 extends Filter
public function parse(array $content, string $model): array
{
return match ($model) {
Response::MODEL_USER => $this->parseUser($content),
Response::MODEL_USER_LIST => $this->handleList(
$content,
'users',
fn ($item) => $this->parseUser($item),
),
Response::MODEL_ACCOUNT => $this->parseUser($content),
Response::MODEL_SITE => $this->parseSite($content),
Response::MODEL_SITE_LIST => $this->handleList(
$content,
"sites",
'sites',
fn ($item) => $this->parseSite($item),
),
Response::MODEL_FUNCTION => $this->parseFunction($content),
Response::MODEL_FUNCTION_LIST => $this->handleList(
$content,
"functions",
'functions',
fn ($item) => $this->parseFunction($item),
),
Response::MODEL_DOCUMENT => $this->parseDocument($content),
Response::MODEL_DOCUMENT_LIST => $this->handleList(
$content,
"documents",
'documents',
fn ($item) => $this->parseDocument($item),
),
Response::MODEL_ROW => $this->parseRow($content),
Response::MODEL_ROW_LIST => $this->handleList(
$content,
"rows",
'rows',
fn ($item) => $this->parseRow($item),
),
default => $content,
};
}
protected function parseUser(array $content): array
{
unset($content['impersonator']);
unset($content['impersonatorUserId']);
return $content;
}
protected function parseSite(array $content): array
{
$content = $this->parseSpecs($content);