chore: More missing transactions (#9811)

* fix: Missing transaction in notifications.update_all

* lint
This commit is contained in:
Tom Moor
2025-08-03 21:52:10 -04:00
committed by GitHub
parent 08a0b72706
commit 34059ce0ef
5 changed files with 5 additions and 13 deletions

View File

@@ -7,10 +7,7 @@ import Route from "~/components/ProfiledRoute";
import env from "~/env";
import useQueryNotices from "~/hooks/useQueryNotices";
import lazy from "~/utils/lazyWithRetry";
import {
matchCollectionSlug as collectionSlug,
matchDocumentSlug as documentSlug,
} from "~/utils/routeHelpers";
import { matchDocumentSlug as documentSlug } from "~/utils/routeHelpers";
const Authenticated = lazy(() => import("~/components/Authenticated"));
const AuthenticatedRoutes = lazy(() => import("./authenticated"));

View File

@@ -37,7 +37,7 @@ if (env.SENTRY_DSN) {
break;
}
return event;
} catch (e) {
} catch (_) {
return event;
}
},

View File

@@ -220,9 +220,11 @@ router.post(
"notifications.update_all",
auth(),
validate(T.NotificationsUpdateAllSchema),
transaction(),
async (ctx: APIContext<T.NotificationsUpdateAllReq>) => {
const { viewedAt, archivedAt } = ctx.input.body;
const { user } = ctx.state.auth;
const { transaction } = ctx.state;
const values: Partial<Notification> = {};
let where: WhereOptions<Notification> = {
@@ -247,7 +249,7 @@ router.post(
let total = 0;
if (!isEmpty(values)) {
total = await Notification.unscoped().findAllInBatches(
{ where },
{ where, transaction, lock: transaction.LOCK.UPDATE },
async (results) => {
await Promise.all(
results.map((notification) =>

View File

@@ -365,9 +365,6 @@ export function addColumnBefore({ index }: { index?: number }): Command {
// move inwards.
const headerSpecialCase = position === 0 && isHeaderColumnEnabled;
// Determine which column to copy alignment from (using original table indices)
const copyFromColumn = position === 0 ? 0 : position - 1;
chainTransactions(
headerSpecialCase ? toggleHeader("column") : undefined,
(s, d) => !!d?.(addColumn(s.tr, rect, position)),

View File

@@ -86,10 +86,6 @@ export class TableLayoutPlugin extends Plugin {
tr = newState.tr;
}
// Get all cells in the last column
const tempState = newState.apply(tr);
const tempSelection = tempState.selection;
// Create a temporary state to use getCellsInColumn
const tableStart = pos + 1;
const cellPositions: number[] = [];