T22: calendar week view + fix workerd fetch binding bug #21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "t22-calendar"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
T22: Calendar screen + fix for a production bug in
createFnContextStacked on #20 (
t21-mcp-setup) → … → #1. Merge those first.⚠️ Production bug found and fixed
createFnContextstored the globalfetchon the context object, and handlers called it asctx.fetch(…). In workerd that throwsTypeError: Illegal invocation, so every registry call inside the Worker failed. That includes every MCPcalltool invocation, and it surfaced as a genericinternal_error. Node-based tests can't see it. I found it while smoke-testing the calendar with a real session.The fix is a wrapper (
(input, init) => fetch(input, init)), plus a regression test that emulates workerd'sthischeck; it fails without the fix. Astra then audited the codebase: no other stored host-object calls.Calendar (
/calendar)?week=YYYY-MM-DD, any day maps to its Monday) with Previous / Today / Next. Days are columns on desktop and a stacked list on mobile, and today is highlighted (aria-current="date").fit.sirius.events,fit.deadlines), run as the signed-in user.src/lib/calendar.tsis pure and tested:mondayOf,weekDays,parseWeek,pragueTime,groupByDay.Verified
bun run lint && bun run typecheck && bun run test: 251 tests. The 5 new calendar-helper tests cover Mondays across years,?weekparsing including invalid input, Prague time across DST, and grouping by Prague day. There are 2createFnContexttests, one of them the workerd regression test./calendar?week=2026-11-16renders 10 events (lecture, tutorial, assessment) and 3 Marast due items in en and cs, with no warnings. Before the fix it showed "Internal error"./,/connectorsand/assistantsrender signed in.Astra review (gpt-6-astra)
It audited host-object usage (no other issues) and found the Prague date maths, timezone formatting and on-demand iCal token sound.
Fixed:
truncatedflag was dropped → warning.🤖 Generated with Claude Code