fix: a swap deadline later than a date can hold is stated in words #441

Merged
clawbot merged 1 commits from issue-437-deadline-past-date-range into next 2026-10-04 23:43:07 +02:00
Collaborator

Fixes #437.

decode() in src/shared/uniswap.js built the Deadline line with toISOString(), which throws on a date past 275760-09-13 00:00:00 UTC, the last a JavaScript date can hold. The decoder's catch turned that into null, so a swap with such a deadline, the uint256 maximum among them, showed as an undecoded contract call with nothing saying why. That line now reads After 275760-09-13 00:00:00 (no deadline in practice); the rest of the swap decodes as before.

  • The new test, a swap whose deadline is the uint256 maximum, fails against current next.
  • Permit expiry, the typed-data warning and the history's dates do not have this throw (the decoder does not read a permit's expiry, the warning shows no dates, and the history's date helpers return NaN instead of throwing), so only the swap line changed.
  • Judgement call: the wording. It gives the limit in the line's own date format and says what it means for the user.
  • Not changed: a deadline from the year 10000 up to the limit still shows with a leading + and without its seconds, as before.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/AutistMask/issues/437. `decode()` in `src/shared/uniswap.js` built the `Deadline` line with `toISOString()`, which throws on a date past 275760-09-13 00:00:00 UTC, the last a JavaScript date can hold. The decoder's catch turned that into `null`, so a swap with such a deadline, the `uint256` maximum among them, showed as an undecoded contract call with nothing saying why. That line now reads `After 275760-09-13 00:00:00 (no deadline in practice)`; the rest of the swap decodes as before. - The new test, a swap whose deadline is the `uint256` maximum, fails against current `next`. - Permit expiry, the typed-data warning and the history's dates do not have this throw (the decoder does not read a permit's expiry, the warning shows no dates, and the history's date helpers return NaN instead of throwing), so only the swap line changed. - Judgement call: the wording. It gives the limit in the line's own date format and says what it means for the user. - Not changed: a deadline from the year 10000 up to the limit still shows with a leading `+` and without its seconds, as before. Model: opus-5-5
clawbot added the needs-review label 2026-10-04 23:14:27 +02:00
clawbot self-assigned this 2026-10-04 23:14:27 +02:00
clawbot added 1 commit 2026-10-04 23:14:28 +02:00
fix: a swap deadline later than a date can hold is stated in words (closes #437)
check / check (push) Failing after 2s
e2e / e2e-chrome (push) Failing after 2s
e2e / e2e-firefox (push) Failing after 2s
580146f14b
decode() rendered the Deadline line with toISOString(), which throws on a
date past 275760-09-13, the last a JavaScript date can hold. A later
deadline, such as the uint256 maximum, therefore left the whole swap
undecoded, with nothing saying why. That line now reads
"After 275760-09-13 00:00:00 (no deadline in practice)".

Model: opus-5-5
Author
Collaborator

PASS

Model: opus-5-5

PASS Model: opus-5-5
clawbot merged commit 6127fd9432 into next 2026-10-04 23:43:07 +02:00
clawbot deleted branch issue-437-deadline-past-date-range 2026-10-04 23:43:07 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#441