Skip to content

Handle checksum key error - #929

Merged
DavidMStraub merged 3 commits into
gramps-project:masterfrom
DavidMStraub:handle_checksum_key_error
Aug 10, 2026
Merged

Handle checksum key error#929
DavidMStraub merged 3 commits into
gramps-project:masterfrom
DavidMStraub:handle_checksum_key_error

Conversation

@DavidMStraub

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an error path in media thumbnail/tile caching where a missing media handle could trigger failures during cache key computation (which flask_caching may log/swallow), ensuring the request reaches the client as a normal 404.

Changes:

  • Move media lookup out of cache-key functions into an unless predicate that skips caching when the media handle does not exist.
  • Update thumbnail/tile cache-key generation to rely on g.cached_media populated by the predicate.
  • Add a regression test asserting missing-thumbnail requests return 404 without flask_caching error logs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/test_endpoints/test_file.py Adds a regression test ensuring unknown thumbnail handles return a clean 404 without cache-backend error logs.
gramps_webapi/api/cache.py Refactors thumbnail/tile caching to prefetch media in unless and avoid aborting during cache-key computation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/test_endpoints/test_file.py
@DavidMStraub
DavidMStraub merged commit f16c84e into gramps-project:master Aug 10, 2026
3 checks passed
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.

2 participants