Conversation
…limit Increase deletion batch limit
Mykobo base improvements - adjustments proposal
Each entry now stores a timestamp. When the map exceeds 50 items, the oldest entries are removed. Entries without timestamps (from before this change) default to 0 and are evicted first.
…alstorage-backup Cap rampEphemerals localStorage to 50 entries with FIFO eviction
✅ Deploy Preview for vortex-sandbox ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for vortexfi ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR packages a production release bundle across frontend persistence, backend quote/ramp routing logic, and database performance improvements (new index + larger cleanup batches).
Changes:
- Frontend: cap persisted ramp ephemerals in
localStorageusing timestamps for LRU-style eviction. - Frontend: switch Mykobo profile query to
skipTokeninstead ofenabled. - Backend: add
created_atindex forquote_tickets, increase expired-quote cleanup batch size, and centralize “fiat → own stablecoin on Base” direct-route checks.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/frontend/src/contexts/rampState.tsx | Adds timestamped ephemeral entries + eviction to limit localStorage growth. |
| apps/frontend/src/components/widget-steps/SummaryStep/TransactionTokensDisplay.tsx | Uses skipToken to avoid running Mykobo profile query when not applicable. |
| apps/api/src/database/migrations/031-add-quote-created-at-index.ts | Adds concurrent index on quote_tickets(created_at DESC) for improved query performance. |
| apps/api/src/api/services/ramp/base.service.ts | Increases expired quote delete batch size for cleanup throughput. |
| apps/api/src/api/services/quote/utils.ts | Introduces isFiatToOwnStablecoinBaseDirect helper. |
| apps/api/src/api/services/phases/handlers/squid-router-phase-handler.ts | Uses new helper to skip SquidRouter step for direct Base routes. |
| apps/api/src/api/services/phases/handlers/fund-ephemeral-handler.ts | Uses new helper to route direct Base onramps to destinationTransfer. |
| apps/api/src/api/services/phases/handlers/final-settlement-subsidy.ts | Uses new helper + extracts the 90% bridge-delivery threshold into a constant. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+21
to
+25
| type RampEphemeralEntry = { | ||
| substrateEphemeral: EphemeralAccount; | ||
| evmEphemeral: EphemeralAccount; | ||
| timestamp: number; | ||
| }; |
|
|
||
| const keys = Object.keys(existing); | ||
| if (keys.length > MAX_RAMP_EPHEMERALS) { | ||
| const sorted = keys.sort((a, b) => (existing[a].timestamp ?? 0) - (existing[b].timestamp ?? 0)); |
| import { StateMetadata } from "../phases/meta-state-types"; | ||
|
|
||
| const EXPIRED_QUOTE_DELETE_BATCH_SIZE = 1000; | ||
| const EXPIRED_QUOTE_DELETE_BATCH_SIZE = 5000; |
…ning in sort, align test batch size - Make `timestamp` optional in `RampEphemeralEntry` for backwards compatibility with entries from older app versions - Use optional chaining (`?.timestamp ?? 0`) in eviction sort to guard against null/corrupt localStorage entries; legacy entries without a timestamp get value 0 (treated as oldest) - Update `expectedDeleteBatchSize` in base.service.test.ts from 500 to 5000 to match the production `EXPIRED_QUOTE_DELETE_BATCH_SIZE` constant
…nts-legacy-handling fix: backwards-compat timestamp, safe eviction sort, aligned test batch size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.