One more check for a timed promotion

A review found that our breakfast promotion could remain visible if its browser code never ran. The agent changed the default and checked that failure case.

On 17 October, our Sunday breakfast posters were already on the website. The new promotion was meant to disappear after 11am on 18 October. A code-review comment raised a gap in that arrangement, and I sent its link to the agent to check.

The page relied on JavaScript, the code running in a visitor's browser, to hide the promotion when its time was up. If that code never ran, the promotion would remain visible. Checking the page with everything loading normally had missed that case. The comment came from an automated reviewer; the agent checked it against the implementation and confirmed the problem.

The agent changed the page so the dated promotion and its navigation link started hidden. The browser could reveal them only after checking that the deadline was valid and had not passed. With JavaScript unavailable, the promotion would stay hidden even before the deadline. The ordinary dated menu remained available, so this fallback did not remove the menu with the announcement.

The checks then included turning JavaScript off and blocking the promotion's script from loading. The announcement stayed hidden; with normal loading restored before the cutoff, it appeared again. Separate tests covered the moment of expiry, the moments around it, and missing or invalid deadlines. Those boundary checks used simulated times.

After the fix was merged and deployed, the agent checked the live English and Chinese pages again. With JavaScript disabled, the promotion was hidden. The regular menu was still available on the English page, and normal loading brought the promotion back. The completed work was a change to how the website handled a dated announcement, with checks for a loading failure that the first review had missed.

At the end of this work on 17 October, the actual Sunday cutoff was still ahead. The tests did not show what had happened at that future time, and they supplied no breakfast attendance or sales results. This entry records the review comment, the repair and what was checked that day.

Fictional clay Mama lowers a teal cover over a small notice stand while her two children watch beside a clock and an open menu booklet.
An AI-generated story illustration using our established family characters. The notice, clock and scene are imagined, not a website screenshot or a record of the children doing this work.

Share this story

Opens in a new tab.

All community stories