Skip to content

fix(cache): clean up lib#4457

Open
MasterPtato wants to merge 1 commit into03-18-fix_config_allow_configuring_topo_dcs_via_map_fix_pg_ssl_mode_configfrom
03-18-fix_cache_clean_up_lib
Open

fix(cache): clean up lib#4457
MasterPtato wants to merge 1 commit into03-18-fix_config_allow_configuring_topo_dcs_via_map_fix_pg_ssl_mode_configfrom
03-18-fix_cache_clean_up_lib

Conversation

@MasterPtato
Copy link
Copy Markdown
Contributor

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@railway-app
Copy link
Copy Markdown

railway-app bot commented Mar 19, 2026

🚅 Deployed to the rivet-pr-4457 environment in rivet-frontend

Service Status Web Updated (UTC)
frontend-cloud 😴 Sleeping (View Logs) Web Mar 31, 2026 at 5:50 am
frontend-inspector 😴 Sleeping (View Logs) Web Mar 22, 2026 at 10:18 am
website ❌ Build Failed (View Logs) Web Mar 19, 2026 at 2:08 am
mcp-hub ✅ Success (View Logs) Web Mar 19, 2026 at 2:07 am
ladle ❌ Build Failed (View Logs) Web Mar 19, 2026 at 2:06 am

Copy link
Copy Markdown
Contributor Author

MasterPtato commented Mar 19, 2026

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 19, 2026

More templates

@rivetkit/virtual-websocket

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/virtual-websocket@4457

@rivetkit/cloudflare-workers

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/cloudflare-workers@4457

@rivetkit/framework-base

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/framework-base@4457

@rivetkit/next-js

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/next-js@4457

@rivetkit/react

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/react@4457

rivetkit

pnpm add https://pkg.pr.new/rivet-dev/rivet/rivetkit@4457

@rivetkit/sql-loader

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sql-loader@4457

@rivetkit/sqlite-vfs

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sqlite-vfs@4457

@rivetkit/traces

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/traces@4457

@rivetkit/workflow-engine

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/workflow-engine@4457

@rivetkit/engine-runner

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner@4457

@rivetkit/engine-runner-protocol

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner-protocol@4457

commit: e65f84d

@claude
Copy link
Copy Markdown

claude bot commented Mar 19, 2026

PR Review: fix(cache): clean up lib

Summary

This PR cleans up the rivet-cache library by removing Redis support (which was only a todo!()), eliminating the in-memory rate-limiting subsystem, removing the generic fetch_one/fetch_all wrappers in favor of the JSON-specific variants, and replacing loose String key types with the typed RawCacheKey newtype. Net result: -309 lines with no apparent functional regression for current callers.


Issues

Medium

  • inner.rs:29 — Undocumented 10x capacity increase: max_capacity silently changed from 1000 to 10000. No comment, PR description mention, or test coverage explains the rationale. Worth at least a comment explaining the new value.

  • Rate limiting removal — no migration note: rate_limit.rs, RateLimitConfig, and CacheInner::rate_limit are fully deleted. The PR description does not explain whether rate limiting is being moved to another layer or dropped entirely. If it is being removed permanently, that is a behavior change worth calling out explicitly.

Low

  • req_config.rs:3use anyhow::*; glob import: CLAUDE.md says "Do not glob import from anyhow. Instead, import individual types and traits." This pre-exists the PR but since the file was significantly reworked, it is a good opportunity to fix.

  • req_config.rs log messages use title case: "Failed to decode value" and "Failed to encode value" — CLAUDE.md convention is lowercase log messages unless referencing specific code symbols.

  • key.rs:109-115Deref<Target = String> is non-idiomatic: The standard Rust convention is Deref<Target = str>. With Target = String, the full String API is transitively exposed on RawCacheKey, which is wider than intended. Callers already use &*key to get a &str, so changing the target to str would be cleaner.

  • driver.rs — Misleading doc comment on process_key: The comment states "In-memory uses simpler keys" but the base key parameter passed to get/delete in InMemoryDriver is intentionally ignored (_base_key). The comment should be removed or reworded.


Positives

  • The rename of fetch_values/set_values/delete_keys to get/set/delete on the driver trait is a clean improvement.
  • Moving serialization responsibility entirely into req_config.rs (removing encode_value/decode_value from Driver) is the right layering.
  • Switching the cache write task clone from driver to cache (Arc<CacheInner>) is correct given Driver no longer derives Clone.
  • Removing the second rate_limits: Cache<String, ExpiringValue> from InMemoryDriver halves the memory overhead per instance.

Generated by Claude Code

@MasterPtato MasterPtato force-pushed the 03-18-fix_cache_clean_up_lib branch from 175706a to 17d21f5 Compare March 19, 2026 20:53
@MasterPtato MasterPtato force-pushed the 03-18-fix_config_allow_configuring_topo_dcs_via_map_fix_pg_ssl_mode_config branch from f07072d to ea5642d Compare March 21, 2026 01:55
@MasterPtato MasterPtato force-pushed the 03-18-fix_cache_clean_up_lib branch from 17d21f5 to de18421 Compare March 21, 2026 01:55
@MasterPtato MasterPtato mentioned this pull request Mar 21, 2026
11 tasks
@MasterPtato MasterPtato force-pushed the 03-18-fix_config_allow_configuring_topo_dcs_via_map_fix_pg_ssl_mode_config branch from ea5642d to f6c3742 Compare March 24, 2026 00:30
@MasterPtato MasterPtato force-pushed the 03-18-fix_cache_clean_up_lib branch from de18421 to e65f84d Compare March 24, 2026 00:30
@MasterPtato MasterPtato mentioned this pull request Mar 24, 2026
11 tasks
@MasterPtato MasterPtato force-pushed the 03-18-fix_cache_clean_up_lib branch from e65f84d to 65200cf Compare March 24, 2026 00:36
@MasterPtato MasterPtato force-pushed the 03-18-fix_config_allow_configuring_topo_dcs_via_map_fix_pg_ssl_mode_config branch from f6c3742 to 10c9ce3 Compare March 24, 2026 00:36
@MasterPtato MasterPtato force-pushed the 03-18-fix_cache_clean_up_lib branch from 65200cf to ea32d90 Compare March 25, 2026 00:05
@MasterPtato MasterPtato force-pushed the 03-18-fix_config_allow_configuring_topo_dcs_via_map_fix_pg_ssl_mode_config branch from 10c9ce3 to 42a11eb Compare March 25, 2026 00:05
@MasterPtato MasterPtato force-pushed the 03-18-fix_cache_clean_up_lib branch from ea32d90 to ddfa969 Compare March 26, 2026 01:18
@MasterPtato MasterPtato force-pushed the 03-18-fix_config_allow_configuring_topo_dcs_via_map_fix_pg_ssl_mode_config branch from 42a11eb to 38080c6 Compare March 26, 2026 01:18
@MasterPtato MasterPtato force-pushed the 03-18-fix_cache_clean_up_lib branch from ddfa969 to bed6ca4 Compare March 26, 2026 20:50
@MasterPtato MasterPtato force-pushed the 03-18-fix_config_allow_configuring_topo_dcs_via_map_fix_pg_ssl_mode_config branch 2 times, most recently from 875b002 to 14a6bb1 Compare March 28, 2026 00:20
@MasterPtato MasterPtato force-pushed the 03-18-fix_cache_clean_up_lib branch from bed6ca4 to 10a4ff1 Compare March 28, 2026 00:20
@MasterPtato MasterPtato force-pushed the 03-18-fix_cache_clean_up_lib branch from 10a4ff1 to 860e71e Compare March 30, 2026 19:40
@MasterPtato MasterPtato force-pushed the 03-18-fix_config_allow_configuring_topo_dcs_via_map_fix_pg_ssl_mode_config branch from 14a6bb1 to 4b7394e Compare March 30, 2026 19:40
@MasterPtato MasterPtato force-pushed the 03-18-fix_config_allow_configuring_topo_dcs_via_map_fix_pg_ssl_mode_config branch from 4b7394e to 876ae4d Compare March 31, 2026 01:40
@MasterPtato MasterPtato force-pushed the 03-18-fix_cache_clean_up_lib branch from 860e71e to 22498e8 Compare March 31, 2026 01:40
@MasterPtato MasterPtato mentioned this pull request Mar 31, 2026
11 tasks
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