Skip to content

Commit c455f58

Browse files
authored
fix: remove init of transaction for global doc access (#14693)
When getting the globals doc permissions we were creating a transaction. This was causing transaction errors to occur where the session was closed already due to a promise.All() during [renderDocument](https://github.com/payloadcms/payload/blob/802a21afea066542a08bbd9fbd8f386f58a94e3d/packages/next/src/views/Document/index.tsx#L170) This change makes it so we no longer create the transaction as is normal for all other db read operations.
1 parent c484a05 commit c455f58

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

packages/payload/src/globals/operations/docAccess.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export const docAccessOperation = async (args: Arguments): Promise<SanitizedGlob
2727
}
2828

2929
try {
30-
const shouldCommit = await initTransaction(req)
3130
const result = await getEntityPermissions({
3231
id: undefined,
3332
blockReferencesPermissions: {},
@@ -38,9 +37,7 @@ export const docAccessOperation = async (args: Arguments): Promise<SanitizedGlob
3837
operations: globalOperations,
3938
req,
4039
})
41-
if (shouldCommit) {
42-
await commitTransaction(req)
43-
}
40+
4441
const sanitizedPermissions = sanitizePermissions({
4542
globals: {
4643
[globalConfig.slug]: result,

0 commit comments

Comments
 (0)