Fix 500 error in Hebrew-year learning range, add download /v4/ and /v2/ request query string logging - #22
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.