Skip to content

Fix negative seconds in submission countdown timer#5146

Open
shivamsingh-007 wants to merge 2 commits into
Cloud-CV:masterfrom
shivamsingh-007:fix/negative-countdown-timer-4594
Open

Fix negative seconds in submission countdown timer#5146
shivamsingh-007 wants to merge 2 commits into
Cloud-CV:masterfrom
shivamsingh-007:fix/negative-countdown-timer-4594

Conversation

@shivamsingh-007

Copy link
Copy Markdown

Summary

Fix negative seconds appearing in the submission countdown timer when
remaining time reaches zero.

Related Issue

Fixes #4594

What changed

  • In \challengeCtrl.js: replaced \�m.remainingSeconds--\ (zero-padded
    display string) with \�m.remainingTime--\ (numeric counter) in both
    countdown timers; changed === 0\ guard to <= 0\ to prevent
    negative values at the transition point
  • In \challengeCtrl.test.js: updated 2 assertions to use the original
    source value instead of referencing the mutated property

Why this approach

The original code decremented the display-formatted string
(\�m.remainingSeconds) instead of the actual numeric counter
(\�m.remainingTime), and the guard used strict equality (=== 0)
which allowed the counter to go negative. Fixing both the decrement
target and the guard resolves the reported issue.

Testing done


  • pm test\ (gulp dev + karma + Chrome headless): 600/600 pass
  • Fix logic verified independently with a standalone Node.js test
    (13 assertions covering countdown, zero transition, edge cases)

Checklist

  • Tests added/updated
  • Docs updated (if user-facing) — n/a, no user-facing change
  • Lint/format passes — gulp lint passed during build
  • Linked issue referenced (BUG: Negative Time Displayed in Submission Countdown Timer #4594)
  • Commits signed off if org requires DCO — EvalAI doesn't require DCO
  • No unrelated changes bundled in

Decrement remaining_time on the source object instead of the
formatted display string, and guard with <= 0 instead of === 0
to prevent the timer from showing negative values at zero.

Fixes Cloud-CV#4594
After the countdown timer fix, vm.remainingTime holds the value
copied from source before the decrement, so assertions must compare
against constants rather than the mutated source property.
Copilot AI review requested due to automatic review settings July 9, 2026 13:38

Copilot AI left a comment

Copy link
Copy Markdown

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.

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.

BUG: Negative Time Displayed in Submission Countdown Timer

2 participants