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 Apr 4, 2026 at 5:43 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

Review: fix(cache): clean up lib

Positive changes

  • Removing the double-serialization roundtrip (Value -> JSON -> Vec<u8>) simplifies the encoder/decoder path and eliminates an extra allocation per write.
  • Moving purge metrics to RequestConfig::purge_local rather than the driver layer is correct separation of concerns.
  • Renaming fetch_values/set_values/delete_keys to get/set/delete improves readability.
  • Removing the Redis stub todo!() arm eliminates a footgun.
  • Capacity bump 1,000 to 10,000: likely intentional, but a brief comment explaining the rationale would help future readers.

Issues

Broken integration tests (main blocker)

engine/packages/cache/tests/integration.rs references APIs removed by this PR:

  • CacheInner::new_in_memory() uses the old three-argument signature; the service_name: String argument was removed.
  • cache.fetch_one() / cache.fetch_all() throughout the test file -- removed and replaced with fetch_one_json / fetch_all_json / fetch_all_json_with_keys.
  • cache.rate_limit(), RateLimitConfig, and RateLimitBucketConfig -- referenced in rate-limit tests but removed from the public API.

These tests will not compile. They must be updated or removed before merging.

Unused Cargo.toml dependencies

  • rivet-env is no longer used in src/ after removing service_name. Remove from [dependencies].
  • futures-util is only used in tests/integration.rs. Move from [dependencies] to [dev-dependencies].

Minor: Deref<Target = String> on RawCacheKey

This exposes the full mutable String API on a newtype meant to carry already-escaped keys. Prefer Deref<Target = str> or AsRef<str> + Borrow<str> to narrow the surface. Soft concern -- the current approach is a common Rust pattern.

Summary

Directionally correct and improves the codebase. The main blocker is broken integration tests that reference removed APIs.

@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 2 times, most recently 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
@MasterPtato MasterPtato force-pushed the 03-18-fix_config_allow_configuring_topo_dcs_via_map_fix_pg_ssl_mode_config branch from 876ae4d to 1876954 Compare March 31, 2026 22:24
@MasterPtato MasterPtato force-pushed the 03-18-fix_cache_clean_up_lib branch from 22498e8 to 0b1f7e6 Compare March 31, 2026 22:24
@MasterPtato MasterPtato mentioned this pull request Mar 31, 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 1876954 to b648533 Compare April 1, 2026 02:11
@MasterPtato MasterPtato force-pushed the 03-18-fix_cache_clean_up_lib branch from 0b1f7e6 to 7e46b06 Compare April 1, 2026 02:11
@MasterPtato MasterPtato force-pushed the 03-18-fix_config_allow_configuring_topo_dcs_via_map_fix_pg_ssl_mode_config branch from b648533 to e1d3163 Compare April 2, 2026 02:47
@MasterPtato MasterPtato force-pushed the 03-18-fix_cache_clean_up_lib branch from 7e46b06 to 4080c12 Compare April 2, 2026 02:47
@MasterPtato MasterPtato force-pushed the 03-18-fix_config_allow_configuring_topo_dcs_via_map_fix_pg_ssl_mode_config branch from e1d3163 to 8e3bc38 Compare April 3, 2026 01:24
@MasterPtato MasterPtato force-pushed the 03-18-fix_cache_clean_up_lib branch from 4080c12 to 3606c4d Compare April 3, 2026 01:24
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