Skip to content

TypeScript client: ticker()/forceTick() discard SQL return values and docs misstate behavior #151

@NikolayS

Description

@NikolayS

Problem

TypeScript exposes ticker() / forceTick() public methods but discards useful SQL return values, and comments/docs are misleading.

SQL returns:

  • pgque.ticker(queue) → tick id or NULL if no tick was created.
  • pgque.ticker() → number of queues processed.
  • pgque.force_tick(queue) → last tick id / status value from SQL.

Current TS methods return Promise<void>. The comment above ticker() says it returns the underlying tick result count, but the method discards the row.

Why this matters

These are supposed to be thin wrappers over SQL primitives. Hiding return values makes tests and manual operation less informative, and the comment is currently wrong.

Suggested fix

  • Make ticker(queue) return bigint | null and ticker() return count, or split into ticker(queue) and tickerAll() to avoid union confusion.
  • Make forceTick(queue) return the SQL result.
  • Update README/API table.
  • Keep any combined force+ticker behavior test-helper-only, not public API.

Acceptance criteria

  • TS method signatures match SQL primitive return values or docs explicitly justify discarding them.
  • Tests assert return values for tick-created and no-tick-needed cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    engineerOwned by an engineer agent (do work, open PR)enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions