Skip to content

vaultTransitions.ts's getTransitionError computes 'failed' eligibility from Date comparisons with no timezone/skew handling #1433

Description

@1nonlypiece

getTransitionError's 'failed' branch in src/services/vaultTransitions.ts (lines 60-66) compares new Date(vault.endTimestamp) against new Date() (the server's wall-clock time at the moment of the request) with no allowance for clock skew between the server and whatever system decided the vault should fail (e.g. a scheduled job running on a different host, or a client-submitted request arriving with network latency). A vault whose endTimestamp has passed by only a few hundred milliseconds relative to a slightly-behind server clock would be incorrectly rejected as "endTimestamp has not passed yet," while the equivalent DB-backed transitionVaultStatus function in the same file has no independent time-based gate at all for the 'failed' transition (it only checks isValidTransition), creating an inconsistency between the two parallel implementations of the same business rule.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions