fix: log lastUsedAt write failures and align the tokens table skeleton

This commit is contained in:
Catalin Pit
2026-08-19 13:13:23 +03:00
parent 63fbf9d155
commit c3e0f01031
2 changed files with 11 additions and 1 deletions
@@ -160,6 +160,9 @@ export default function ApiTokensPage() {
<TableCell>
<Skeleton className="h-4 w-16 rounded-full" />
</TableCell>
<TableCell>
<Skeleton className="h-4 w-16 rounded-full" />
</TableCell>
<TableCell>
<Skeleton className="h-4 w-12 rounded-full" />
</TableCell>
@@ -1,6 +1,7 @@
import { prisma } from '@documenso/prisma';
import { AppError, AppErrorCode } from '../../errors/app-error';
import { logger } from '../../utils/logger';
import { hashString } from '../auth/hash';
import { assertOrganisationRatesAndLimits } from '../rate-limit/assert-organisation-rates-and-limits';
@@ -105,7 +106,13 @@ export const getApiTokenByToken = async ({ token, bypassRateLimit = false }: Get
lastUsedAt: new Date(),
},
})
.catch(() => null);
.catch((err) => {
logger.warn({
msg: 'Failed to update API token lastUsedAt',
apiTokenId: apiToken.id,
err,
});
});
return {
...apiToken,