Skip to content

Fix 500 error in Hebrew-year learning range, add download /v4/ and /v2/ request query string logging - #22

Merged
mjradwin merged 2 commits into
mainfrom
fix-hebrew-year-learning-range
Aug 21, 2026
Merged

Fix 500 error in Hebrew-year learning range, add download /v4/ and /v2/ request query string logging#22
mjradwin merged 2 commits into
mainfrom
fix-hebrew-year-learning-range

Conversation

@mjradwin

Copy link
Copy Markdown
Member

No description provided.

mjradwin and others added 2 commits August 21, 2026 12:04
A /v4/ Hebrew-year calendar asking only for one of the six daily-learning
series hebcal-go cannot generate (e.g. hebcal_5787h.pdf with dksa=on)
produced no local events, and learningRange gave up on any Hebrew year --
returning ok=false and 500ing with "cannot determine the calendar's date
range".

A Hebrew year does have a fixed Gregorian span: 1 Tishrei of the year
through the day before 1 Tishrei of the next (NumYears extends the far end),
widened to whole Gregorian months by wholeMonths. Compute it so the fallback
fetch has a range to request.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A /v4/<base64>/<name>.pdf URL carries its calendar options as an opaque
base64 protobuf, and the legacy /v2/h/<base64>/<name>.pdf carries them as a
base64 query string; either way the access log's "url" is unreadable when
debugging a request (as with the hebcal_5787h.pdf bug). Record the query
string the message decodes to under a new "qs" log key, e.g.
"v=1&M=on&yt=H&year=5787&lg=s&dksa=on&mm=0", which makes the request both
readable and reproducible (it round-trips through DecodeV2 and pastes onto a
hebcal.com URL). The classic /hebcal/index.cgi/ form already carries its
query in the logged URL, so it is left alone.

MessageToQuery is a field-for-field port of hebcal-web's
deserializeDownload.js, verified byte-identical against its output (via
downloadHref2 + deserializeDownload) across eight payloads covering
locations, date ranges, and every daily-learning series. reqlog.Collector
carries the string the way it already carries the error "msg" and folded
subrequests; the middleware emits it right after "url".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mjradwin
mjradwin merged commit c212474 into main Aug 21, 2026
2 checks passed
@mjradwin
mjradwin deleted the fix-hebrew-year-learning-range branch August 21, 2026 19:59
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