Skip to content

Commit 2b5a705

Browse files
committed
fix(webapp): the tick re-authorization user read moves off the replica
Same boundary rule as the membership read above it: replica lag must not extend access a background check should have revoked.
1 parent 331f80e commit 2b5a705

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

apps/webapp/app/services/dashboardAgentWatches.server.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ export async function authorizeWatchEnvironment(params: {
109109

110110
if (!environment) return { ok: false, reason: "access_revoked" };
111111

112-
const user = await $replica.user.findFirst({
112+
// Primary for the same reason as the membership read above: this decides
113+
// access for a background tick, and lag must not extend it.
114+
const user = await prisma.user.findFirst({
113115
where: { id: params.userId },
114116
select: { admin: true },
115117
});

0 commit comments

Comments
 (0)