Skip to content

Debug event reference ​

Diagnostic notifications emitted by vuqs. Reporters observe these events; they do not control or cancel the operation that produced them.

Experimental protocol

Event codes and payloads are governed by DEBUG_PROTOCOL_VERSION, outside normal semver. The typed map is exported from @vuqs/core/debug-protocol.

ts
import { addDebugReporter } from '@vuqs/core'

const stop = addDebugReporter((event) => {
  console.log(event.code, event.data)
})

For activation, filtering, console output, and SSR isolation, see the debugging guide.

Events ​

Expand a payload to see its property types and meanings. A ? marks an optional property. Events without payloads carry undefined.

Bindings ​

Event Payload Emitted when Level
binding:createdA query binding is created.debug
binding:disposedA query binding leaves its Vue effect scope.debug
binding:setA binding requests a patch or replacement transaction.debug

Transactions and navigation ​

Event Payload Emitted when Level
tx:startThe adapter runtime assigns an id to a query transaction.debug
gtq:enqueueSerialized path changes enter the adapter write queue.debug
gtq:coalesceAnother write joins the current queue batch and its options are merged.debug
gtq:scheduleThe queue schedules its next flush.debug
gtq:flushA queue batch materializes the next query and begins navigation.debug
gtq:flush-skipA scheduled queue flush finds no pending paths.debug
gtq:settleCommitted URL paths are removed from the optimistic overlay.debug
gtq:resetNoneThe adapter write queue is reset.debug
adapter:navigateThe core or a standalone adapter requests URL navigation.debug
adapter:commitThe adapter confirms a managed navigation or the query changes externally.debug
adapter:errorAn adapter navigation throws or rejects.warn
adapter:missingNoneuseQueryAdapter() finds no adapter in the current injection scope.debug

A managed adapter:commit is emitted after successful navigation, before queue settlement. Its source distinguishes managed writes from external query changes. A testing adapter without memory does not emit a managed commit when simulation leaves its query unchanged.

Parsing and defaults ​

Event Payload Emitted when Level
engine:clear-on-defaultThe engine omits a value that equals its resolved default.debug
engine:parse-missA value present in the URL cannot be decoded by its query param.warn

Module coordination ​

Event Payload Emitted when Level
hooks:subscribeA module subscribes to a query hook.debug
hooks:emitA query hook synchronously dispatches to its subscribers.debug
pipeline:tapA module registers one or more query pipeline transforms.debug

Runtime defaults ​

Event Payload Emitted when Level
rd:setA runtime-default layer sets one or more values.debug
rd:clearNoneThe runtime-default layer is cleared explicitly.debug
rd:resetA query context change resets the runtime-default layer.debug
rd:registerThe runtime-default layer is registered or disposed.debug

Context ​

Event Payload Emitted when Level
ctx:buildThe context module builds a query for another context.debug
ctx:switchswitchTo() requests navigation to another query context.debug
ctx:changeThe active query context changes.debug

Storage ​

Event Payload Emitted when Level
storage:restore-startThe storage module starts its initialization policy.debug
storage:restoreStorage initialization reaches a terminal outcome.debug
storage:writeA storage revision starts saving or removing a snapshot.debug
storage:coalesceA newer storage revision replaces one that has not started yet.debug
storage:errorA storage load, validation, serialization, save, removal, or restore operation fails.warn

Serialization ​

Event Payload Emitted when Level
serializer:clear-on-defaultThe standalone serializer omits a value equal to its default.debug
serializer:buildThe standalone serializer finishes building a query object.debug

Custom module logs ​

Event Payload Emitted when Level
module:logA third-party module writes through createDebugLogger().debug
module:warnA third-party module warns through createDebugLogger().warn

Event shape @vuqs/core ​

Every reporter receives the same frozen envelope. DebugEvent, DebugContext, and DebugLevel are exported from @vuqs/core:

ts
interface DebugContext {
  readonly runtimeId?: string
  readonly bindingId?: string
  readonly transactionIds?: readonly number[]
  readonly batchId?: number
}

interface DebugEvent {
  readonly code: string
  readonly scope: string
  readonly level: DebugLevel
  readonly seq: number
  readonly timestamp: number
  readonly monotonicTime?: number
  readonly context?: DebugContext
  readonly data: unknown
}

Properties

PropertyTypeDescription
codestringThe event code.
scopestringThe event's scope.
level'debug' | 'warn'The diagnostic level.
seqnumberThe global monotonic event sequence.
timestampnumberEpoch milliseconds from Date.now().
monotonicTimenumberOptional high-resolution time from performance.now().
contextDebugContextOptional runtime, binding, transaction and batch identifiers.
dataunknownThe payload for the event code.

The strict KnownDebugEvent union narrows data from code. Import it and the complete DebugEventMap from @vuqs/core/debug-protocol when building protocol-aware tooling.

DebugEmissionContext ​

ts
type DebugEmissionContext = Omit<DebugContext, 'runtimeId'>

The context supplied by an emitter. The channel supplies runtimeId. This type is exported from @vuqs/core.

Correlation ​

seq orders events across the global debug stream. Context identifiers relate events to an adapter runtime, binding, transaction, or navigation batch. Context fields are optional because not every event belongs to each of those operations.

A batchId identifies one write window, and every queue event in that window shares it. gtq:enqueue lists its own transaction. gtq:flush, adapter:navigate, adapter:commit and gtq:settle list every observed transaction in the batch in ascending order.

  • A navigation keeps the context captured when it flushed. Its gtq:settle carries that context even when observation detaches and resumes before the navigation completes. A later batch on the same path does not inherit it.
  • A gtq:settle caused by an external query change carries the open batch's context, when one exists. transactionIds lists every transaction in that batch, not the writers of each settled path.
  • A gtq:settle lists every path it removes, including paths written while no reporter was attached.
  • Writes made without an attached reporter are recorded in no batch, and attaching later does not recover their transaction ids. The flush of such a write that is still queued when a reporter attaches has a batchId without transactionIds. The settlement of a navigation invoked before a reporter attached has neither.

For operation sequences and their console results, see Write lifecycle.

Summary policies and console examples are documented in Summary and trace.

Released under the MIT License. Inspired by nuqs.