a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

revert to normal serverMutationContext

+2 -8
+2 -8
app/api/rpc/[command]/push.ts
··· 9 9 import { drizzle } from "drizzle-orm/node-postgres"; 10 10 import { Lock } from "src/utils/lock"; 11 11 import { pool } from "supabase/pool"; 12 + import { serverMutationContext } from "src/replicache/serverMutationContext"; 12 13 13 14 const mutationV0Schema = z.object({ 14 15 id: z.number(), ··· 85 86 .select() 86 87 .from(permission_token_rights) 87 88 .where(eq(permission_token_rights.token, token.id)); 88 - let { getContext, flush } = cachedServerMutationContext( 89 - tx, 90 - token.id, 91 - token_rights, 92 - ); 93 - 94 89 let lastMutations = new Map<string, number>(); 95 90 console.log(pushRequest.mutations.map((m) => m.name)); 96 91 for (let mutation of pushRequest.mutations) { ··· 102 97 continue; 103 98 } 104 99 try { 105 - let ctx = getContext(mutation.clientID, mutation.id); 100 + let ctx = serverMutationContext(tx, token.id, token_rights); 106 101 await mutations[name](mutation.args as any, ctx); 107 102 } catch (e) { 108 103 console.log( ··· 129 124 target: replicache_clients.client_id, 130 125 set: { last_mutation: sql`excluded.last_mutation` }, 131 126 }); 132 - await flush(); 133 127 }); 134 128 timeProcessingMutations = performance.now() - start; 135 129