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
7 changes: 7 additions & 0 deletions apps/api/src/pkg/keys/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ export class KeyService {
latency: performance.now() - dbStart,
});

this.logger.info("raw db response", {
hash: hash,
dbRes: JSON.stringify(dbRes),
});

if (!dbRes?.keyAuth?.api) {
return null;
}
Expand Down Expand Up @@ -398,6 +403,7 @@ export class KeyService {
if (!data.workspace) {
this.logger.warn("workspace not found, trying again", {
workspace: data.key.workspaceId,
data: JSON.stringify(data),
});
await this.cache.keyByHash.remove(keyHash);
const ws = await this.db.primary.query.workspaces.findFirst({
Expand All @@ -410,6 +416,7 @@ export class KeyService {
return Err(new DisabledWorkspaceError(data.key.workspaceId));
}
data.workspace = ws;
await this.cache.keyByHash.set(keyHash, data);
}

if ((data.forWorkspace && !data.forWorkspace.enabled) || !data.workspace?.enabled) {
Expand Down
Loading