fix: Redis expire guard, transferOwnership prev-owner, SVG regex
- Redis get() rejects legacy expire=0 entries and cleans them up - transferOwnership invalidates previous owner in addition to new - SVG regex uses non-greedy match and handles self-closing <svg /> - SVG fallback returns empty string instead of HTML wrapper - Memory channel comment: FIFO eviction, not timestamp-based
This commit is contained in:
4 files changed
+17
-3
No files matched your search
@@ -327,13 +327,22 @@ export const groupRouter = createTRPCRouter({
|
||||
await throwIfGroupNotFoundAsync(ctx.db, input.groupId);
|
||||
await throwIfGroupNameIsReservedAsync(ctx.db, input.groupId);
|
||||
|
||||
const group = await ctx.db.query.groups.findFirst({
|
||||
columns: { ownerId: true },
|
||||
where: eq(groups.id, input.groupId),
|
||||
});
|
||||
|
||||
await ctx.db
|
||||
.update(groups)
|
||||
.set({
|
||||
ownerId: input.userId,
|
||||
})
|
||||
.where(eq(groups.id, input.groupId));
|
||||
|
||||
invalidateUserCache(input.userId);
|
||||
if (group?.ownerId && group.ownerId !== input.userId) {
|
||||
invalidateUserCache(group.ownerId);
|
||||
}
|
||||
}),
|
||||
deleteGroup: permissionRequiredProcedure
|
||||
.requiresPermission("admin")
|
||||
|
||||
Reference in new issue
Block a user