fix: read-after-write issues (#215)

* fix: read-after-write issues

* fix: coderabbit comments

* fix: clear cache on invite

* fix: use primary after a read
This commit is contained in:
Carl-Gerhard Lindesvärd
2025-10-31 09:56:07 +01:00
committed by GitHub
parent abacf66155
commit f454449365
19 changed files with 470 additions and 167 deletions

View File

@@ -32,7 +32,7 @@ import {
differenceInWeeks,
formatISO,
} from 'date-fns';
import { getProjectAccessCached } from '../access';
import { getProjectAccess } from '../access';
import { TRPCAccessError } from '../errors';
import {
cacheMiddleware,
@@ -367,7 +367,7 @@ export const chartRouter = createTRPCRouter({
.input(zChartInput)
.query(async ({ input, ctx }) => {
if (ctx.session.userId) {
const access = await getProjectAccessCached({
const access = await getProjectAccess({
projectId: input.projectId,
userId: ctx.session.userId,
});