Skip to content

feat: v0.18.0 — Built-In Cache Adapter#26

Merged
scarver2 merged 4 commits into
masterfrom
0.18.0
Apr 5, 2026
Merged

feat: v0.18.0 — Built-In Cache Adapter#26
scarver2 merged 4 commits into
masterfrom
0.18.0

Conversation

@scarver2
Copy link
Copy Markdown
Owner

@scarver2 scarver2 commented Apr 5, 2026

Summary

  • Adds optional cache: and default_ttl: 300 kwargs to Printavo::Client — accepts any object responding to fetch(key, expires_in:) { } and delete(key), matching the Rails.cache interface
  • Adds Printavo::MemoryStore — thread-safe, TTL-aware in-memory cache store for non-Rails usage
  • GraphqlClient#query is now cache-aware; #mutate always bypasses the cache
  • Cache keys are stable 16-hex SHA-256 digests of normalized query + variables ("printavo:gql:<hash>")
  • Updates docs/CACHING.md — replaces the "Future: Built-In Cache Adapter" placeholder with full shipped usage examples
  • Updates docs/TODO.md — marks cache adapter tasks complete, adds v0.18.0 entry
  • Removes Built-In Cache Adapter from docs/FUTURE.md — it's shipped

Test plan

  • Printavo::MemoryStore spec — 8 examples covering cache miss, hit, TTL expiry, multi-key, delete
  • GraphqlClient caching describe block — 6 examples covering deduplication, cache bypass on mutate, separate keys for different queries/variables
  • Client spec — 2 new examples for cache: and default_ttl: kwargs
  • 749 examples, 0 failures, 100% line coverage, 0 RuboCop offenses

🤖 Generated with Claude Code

scarver2 and others added 4 commits April 5, 2026 07:20
Printavo V2 GraphQL is a transactional API with no pre-aggregated analytics
queries. Replace the vague "Analytics / Reporting Expansion" entry with an
accurate note and concrete client-side aggregation helper specs that require
full pagination (and therefore a cache adapter as a prerequisite). Remove
stale shipped-feature entries (CLI, Retry/Backoff, Mutations) from FUTURE.md
and Multi-Language SDK Family from TODO.md stretch goals.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…aching)

- Add optional `cache:` / `default_ttl:` kwargs to `Printavo::Client`
- Add `Printavo::MemoryStore` — thread-safe, TTL-aware in-memory cache store
- `GraphqlClient#query` is now cache-aware; `#mutate` always bypasses cache
- Cache keys are stable SHA-256 digests of normalized query + variables
- Update `docs/CACHING.md` — replace future-tense section with shipped usage
- Update `docs/TODO.md` — mark cache adapter tasks complete, add v0.18.0 entry
- 749 examples, 0 failures, 100% line coverage, 0 RuboCop offenses

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@scarver2 scarver2 merged commit b8ac50e into master Apr 5, 2026
4 checks passed
@scarver2 scarver2 deleted the 0.18.0 branch April 5, 2026 21:25
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