Skip to content

fix(twitch): reject invalid IRC timestamps - #908

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
aiirvizionz:clientkit/twitch-safe-timestamp
Aug 1, 2026
Merged

fix(twitch): reject invalid IRC timestamps#908
ralyodio merged 1 commit into
profullstack:masterfrom
aiirvizionz:clientkit/twitch-safe-timestamp

Conversation

@aiirvizionz

Copy link
Copy Markdown
Contributor

Summary

  • reject non-decimal, unsafe, and out-of-range Twitch IRC timestamps
  • fall back to the current time instead of throwing while converting an invalid Date
  • isolate timestamp parsing so malformed IRC tags can be tested without a live connection

Root cause

Number.isFinite() does not guarantee that a numeric value can be represented as a valid JavaScript Date. A finite tmi-sent-ts value outside the supported date range reached toISOString() and threw while processing an incoming Twitch message. Numeric formats that Twitch does not emit, such as exponent or fractional notation, were also accepted.

Verification

  • 9 focused Vitest cases pass for valid, missing, malformed, unsafe, and out-of-range values
  • git diff --check

The full workspace install/typecheck is currently blocked by the checked-in lockfile entry for @profullstack/autoblog@0.4.0, whose tarball has no integrity metadata. GitHub CI remains the authoritative full-repository check.

Copilot AI review requested due to automatic review settings August 1, 2026 18:21
@aiirvizionz
aiirvizionz marked this pull request as ready for review August 1, 2026 18:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: git fetch upstream master && git rebase upstream/master.

1 similar comment
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: git fetch upstream master && git rebase upstream/master.

@ralyodio
ralyodio merged commit f623c19 into profullstack:master Aug 1, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants