Skip to content

Release 2026-06-11: prod-500 hotfixes #1157 + #1158#1162

Merged
rdhyee merged 5 commits into
productionfrom
master
Jun 11, 2026
Merged

Release 2026-06-11: prod-500 hotfixes #1157 + #1158#1162
rdhyee merged 5 commits into
productionfrom
master

Conversation

@rdhyee

@rdhyee rdhyee commented Jun 11, 2026

Copy link
Copy Markdown
Member

Fixes prod 500s #1155 (work-page TypeError, publication_date race) and #1156 (widget DoesNotExist on junk ids) — the pre-cutover hotfix release planned in the relaunch memo §6, approved by Eric in today's 10:00 meeting.

Promotes master (containing merged #1157, #1158) to production. Both fixes red→green tested on the 1.11 and 4.2 stacks; deployed and smoke-tested on test.unglue.it this morning (branch test.unglue.it).

Follows the release-PR pattern of #1134/#1150.

🤖 Generated with Claude Code

rdhyee and others added 5 commits June 8, 2026 10:32
Compute the publication year range from a single evaluated edition
queryset instead of two separate (asc + desc) queries. The previous
code initialized `latest_publication` to None and set it only from the
second query; when the dated-edition set changed between the two reads
(e.g. concurrent edition loading) the second query could find no
truthy dates, leaving `latest_publication` None and crashing on
`earliest_publication + "-" + latest_publication`.

Also switch to save(update_fields=['publication_range']) so this
nominally-read property doesn't persist other (possibly stale)
in-memory Work fields.

Adds WorkTests regression coverage: mixed null/blank/valid dates,
single-year vs range, all-blank, and a query-count guard proving the
single-query shape.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The api `widget` view treated any non-"featured", non-10/13-char token
as a work id and called safe_get_work() without catching
Work.DoesNotExist, so /api/widget/<bad-id>/ returned 500 instead of the
existing empty-widget response. Two related defects fixed at the same
time:

- convert_10_to_13() returns None for an invalid ISBN-10, after which
  `len(isbn)` raised TypeError. Guard with `if isbn and len(isbn)==13`.
- widget.html renders "...ISBN {{isbn}}..." but the work=None paths did
  not pass `isbn`. Pass it into every render path.

Wrap safe_get_work() in try/except Work.DoesNotExist -> render empty
widget, matching the existing Identifier.DoesNotExist handling.

Adds api ApiTests regression coverage: non-numeric token, numeric
unknown id, and invalid ISBN-10 all return 200.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Keeps the Python 'if date' guard as belt-and-suspenders: the structural
invariant (years contains only truthy strings) stays enforced locally,
independent of the queryset.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Fix #1155: TypeError in Work.publication_date from two-query race
Fix #1156: widget endpoint 500s on unknown/non-numeric/invalid ids
@rdhyee rdhyee merged commit 2201c89 into production Jun 11, 2026
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