mirror of
https://github.com/outline/outline.git
synced 2026-01-06 02:59:54 -06:00
chore: More missing transactions (#9811)
* fix: Missing transaction in notifications.update_all * lint
This commit is contained in:
@@ -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"));
|
||||
|
||||
@@ -37,7 +37,7 @@ if (env.SENTRY_DSN) {
|
||||
break;
|
||||
}
|
||||
return event;
|
||||
} catch (e) {
|
||||
} catch (_) {
|
||||
return event;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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) =>
|
||||
|
||||
@@ -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)),
|
||||
|
||||
@@ -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[] = [];
|
||||
|
||||
Reference in New Issue
Block a user