Skip to content

Estimate waiting room wait as 24 seconds per spot ahead#516

Merged
jahooma merged 1 commit intomainfrom
jahooma/wait-estimate-24s
Apr 19, 2026
Merged

Estimate waiting room wait as 24 seconds per spot ahead#516
jahooma merged 1 commit intomainfrom
jahooma/wait-estimate-24s

Conversation

@jahooma
Copy link
Copy Markdown
Contributor

@jahooma jahooma commented Apr 19, 2026

Reduces the queued wait-time estimate from 60 seconds to 24 seconds (0.4 × 60) per spot ahead, better reflecting actual admission throughput. Updates the constant in session-view.ts and the matching test constant.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 19, 2026

Greptile Summary

This PR reduces the queued wait-time estimate shown to users from 60 seconds (1 minute) to 24 seconds per spot ahead in the waiting room queue, better reflecting observed admission throughput. Both the production constant in session-view.ts and the mirrored test constant in session-view.test.ts are updated consistently.

  • WAIT_MS_PER_SPOT_AHEAD changed from 60_00024_000 in session-view.ts
  • JSDoc comment updated to reflect the new 24-second unit
  • Test constant WAIT_PER_SPOT_MS updated from 60_00024_000 in the test file
  • Minor: the test description on line 30 still refers to "minutes" rather than seconds — a trivial cosmetic inconsistency left behind by the change

Confidence Score: 5/5

Safe to merge — purely a tuning change to a display-only wait estimate with no logic or data-path risk.

The change is a single numeric constant update with a matching test update. The constant only affects a rough UX estimate shown to queued users; it has no impact on admission logic, data integrity, or security. The only finding is a stale 'minutes' word in a test description, which is cosmetic and non-blocking.

No files require special attention.

Important Files Changed

Filename Overview
web/src/server/free-session/session-view.ts Constant WAIT_MS_PER_SPOT_AHEAD updated from 60 000 ms (1 min) to 24 000 ms (24 s); JSDoc comment updated accordingly. No logic changes.
web/src/server/free-session/tests/session-view.test.ts Test constant WAIT_PER_SPOT_MS updated to match; test on line 30 still describes the unit as 'minutes' which is now inaccurate after the change to 24 s.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User polling session state] --> B{row status?}
    B -- active & not expired --> C[Return active response\nwith remainingMs]
    B -- active & in grace window --> D[Return ended response\nwith gracePeriodRemainingMs]
    B -- active & past grace window --> E[Return null\ncaller re-queues]
    B -- queued --> F[estimateWaitMs\nposition - 1 × 24 000 ms]
    F --> G[Return queued response\nwith estimatedWaitMs]
    B -- null row --> H[Return null]
Loading

Comments Outside Diff (1)

  1. web/src/server/free-session/__tests__/session-view.test.ts, line 30 (link)

    P2 Stale test description after constant change

    The test description still says 'position N → (N-1) minutes ahead' but with the new constant of 24 seconds per spot the unit is no longer minutes. This can mislead future readers into thinking the wait is measured in minutes when it is in fact 24-second increments.

Reviews (1): Last reviewed commit: "Estimate waiting room wait as 24 seconds..." | Re-trigger Greptile

@jahooma jahooma merged commit 27cbb10 into main Apr 19, 2026
31 of 34 checks passed
@jahooma jahooma deleted the jahooma/wait-estimate-24s branch April 19, 2026 22:56
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.

1 participant