Skip to content

Commit f302019

Browse files
KyleAMathewsclaude
andcommitted
refactor(db): remove dead DIRECT_TRANSACTION_METADATA_KEY code
The only consumer was in state.ts, which was removed in the prior commit. Clean up the orphaned constant, import, and metadata usage in mutations.ts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1ade6aa commit f302019

2 files changed

Lines changed: 3 additions & 11 deletions

File tree

packages/db/src/collection/mutations.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
UndefinedKeyError,
1818
UpdateKeyNotFoundError,
1919
} from '../errors'
20-
import { DIRECT_TRANSACTION_METADATA_KEY } from './transaction-metadata.js'
2120
import type { Collection, CollectionImpl } from './index.js'
2221
import type { StandardSchemaV1 } from '@standard-schema/spec'
2322
import type {
@@ -231,9 +230,7 @@ export class CollectionMutationsManager<
231230
} else {
232231
// Create a new transaction with a mutation function that calls the onInsert handler
233232
const directOpTransaction = createTransaction<TOutput>({
234-
metadata: {
235-
[DIRECT_TRANSACTION_METADATA_KEY]: true,
236-
},
233+
metadata: {},
237234
mutationFn: async (params) => {
238235
// Call the onInsert handler with the transaction and collection
239236
return await this.config.onInsert!({
@@ -430,9 +427,7 @@ export class CollectionMutationsManager<
430427

431428
// Create a new transaction with a mutation function that calls the onUpdate handler
432429
const directOpTransaction = createTransaction<TOutput>({
433-
metadata: {
434-
[DIRECT_TRANSACTION_METADATA_KEY]: true,
435-
},
430+
metadata: {},
436431
mutationFn: async (params) => {
437432
// Call the onUpdate handler with the transaction and collection
438433
return this.config.onUpdate!({
@@ -536,9 +531,7 @@ export class CollectionMutationsManager<
536531
// Create a new transaction with a mutation function that calls the onDelete handler
537532
const directOpTransaction = createTransaction<TOutput>({
538533
autoCommit: true,
539-
metadata: {
540-
[DIRECT_TRANSACTION_METADATA_KEY]: true,
541-
},
534+
metadata: {},
542535
mutationFn: async (params) => {
543536
// Call the onDelete handler with the transaction and collection
544537
return this.config.onDelete!({

packages/db/src/collection/transaction-metadata.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)