Skip to main content
Version: Next

StorageTransactionView

A read-only view of a StorageTransaction: only the journal-backed introspection accessors, without the lifecycle methods. The accessors are synchronous and expose the original pre-serialization values. They cover every write recorded while the transaction was open, under either write policy — with the one exception noted on enqueuedUrls. A view is valid until the transaction is disposed.

Implemented by

Index

Properties

readonlydatasetItems

datasetItems: { datasetId: string; item: Dictionary }[]

Items pushed to datasets during the transaction, in push order.

readonlyenqueuedUrls

enqueuedUrls: { label?: string; url: string }[]

URLs enqueued to request queues during the transaction, under either write policy. Recorded as requested, so duplicate, already-present and backend-rejected URLs are included.

One gap: unless a caller of addRequestsBatched() waits for every chunk (waitForAllRequestsToBeAdded or maxNewRequests, both of which enqueueLinks sets when a crawl limit applies), the chunks after the first are added by a background writer that outlives the transaction and is not recorded here.

readonlykeyValueStoreChanges

keyValueStoreChanges: Record<string, Record<string, { changedValue: unknown; options?: RecordOptions }>>

Key-value store changes made during the transaction, keyed by store id, last write per key.

readonlystate