Skip to content

Guard findOldestCreatedAt against an empty statuses set #60

Description

@endrju19

PostgresOutboxStore.findOldestCreatedAt / MysqlOutboxStore.findOldestCreatedAt build WHERE status IN (<placeholders>). If statuses is empty, placeholders is "", producing IN () — a syntax error on both Postgres and MySQL.

Latent, not currently reachable: the only production caller (MicrometerOutboxMetrics.querySnapshot) always passes OutboxStatus.entries.toSet(), which is non-empty.

Fix: early-return emptyMap() when statuses.isEmpty() in both adapters, and/or document the non-empty precondition on the OutboxStore.findOldestCreatedAt KDoc.

Flagged as a separate follow-up during review of #58.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions