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 26, 2026 at 12:37 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

Cache Library Cleanup Review

Good cleanup overall — removes dead code (Redis was a todo!() stub), eliminates double-serialization overhead, and better organizes metrics. A few issues to address before merging.

Compilation Failures in Integration Tests

The integration tests were not updated and will fail to compile:

engine/packages/cache/tests/integration.rs:10new_in_memory signature changed but tests still pass the old 3-argument signature. The service_name: String argument was removed, so CacheInner::new_in_memory("cache-test".to_owned(), 1000, None) must become CacheInner::new_in_memory(1000, None).

Tests still call removed public APIfetch_all (lines 17, 66, 316, 364), fetch_one (lines 103, 114, 147, 173, 184, 214, 225, 255, 287, 301, 350), and rate_limit (lines 422, 436, 467, 481, 498, 512, 528) are all removed by this PR but still used in the integration test file. These need to be migrated to fetch_one_json/fetch_all_json equivalents or deleted if the functionality is intentionally dropped.

Rate Limiting Removal

The rate_limit module is deleted entirely. If this is intentional dead-code removal, it would help to confirm in the PR description that no callers remain in production paths. The guard-core package has its own rate limiting (RateLimitConfig, RateLimiter) which is unrelated and fine.

Minor: Deref target should be str, not String

In engine/packages/cache/src/key.rs, the Deref impl targets String rather than str. Deref-ing to str is the idiomatic target for String newtypes — it matches what String itself derefs to and gives &str in one step rather than two. Minor and does not affect correctness here since &String coerces to &str via Borrow.

Positives

  • Removing the double-serialization layer (encoder/decoder now work on Vec<u8>/&[u8] directly instead of an intermediate serde type) is a nice simplification.
  • Moving purge metrics from driver.delete to purge_local in req_config.rs is the right location since it has base_key context naturally.
  • Removing Clone from Driver/InMemoryDriver and cloning Arc<CacheInner> instead is correct.
  • Cache capacity bump from 1000 to 10000 is reasonable.
  • Removing the Redis todo!() variant eliminates a latent panic.

@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 from 38080c6 to 875b002 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 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
@NathanFlurry NathanFlurry mentioned this pull request Mar 28, 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