Skip to content

fix: backwards-compat timestamp, safe eviction sort, aligned test batch size#1192

Merged
ebma merged 2 commits into
stagingfrom
copilot/fix-review-comments-legacy-handling
Jun 3, 2026
Merged

fix: backwards-compat timestamp, safe eviction sort, aligned test batch size#1192
ebma merged 2 commits into
stagingfrom
copilot/fix-review-comments-legacy-handling

Conversation

Copilot AI commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Three fixes from the PR review targeting rampState.tsx and base.service.test.ts.

Changes

  • timestamp made optional in RampEphemeralEntryreadRampEphemerals() can return entries persisted by older app versions that lack this field; marking it required was unsafe and inaccurate.

  • Optional chaining in eviction sort — guards against corrupted localStorage entries (e.g. { "someId": null }). Legacy entries without a timestamp fall back to 0, treating them as the oldest and evicting them first.

    // Before
    keys.sort((a, b) => (existing[a].timestamp ?? 0) - (existing[b].timestamp ?? 0));
    // After
    keys.sort((a, b) => (existing[a]?.timestamp ?? 0) - (existing[b]?.timestamp ?? 0));
  • Test batch size aligned with productionexpectedDeleteBatchSize updated from 5005000 to match EXPIRED_QUOTE_DELETE_BATCH_SIZE in base.service.ts, preventing a false test failure after the batch size increase.

Copilot AI assigned Copilot and ebma Jun 3, 2026
@netlify

netlify Bot commented Jun 3, 2026

Copy link
Copy Markdown

Deploy Preview for vortex-sandbox ready!

Name Link
🔨 Latest commit 4f77d21
🔍 Latest deploy log https://app.netlify.com/projects/vortex-sandbox/deploys/6a1ff196c124bc0008b149a3
😎 Deploy Preview https://deploy-preview-1192--vortex-sandbox.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jun 3, 2026

Copy link
Copy Markdown

Deploy Preview for vortexfi ready!

Name Link
🔨 Latest commit 4f77d21
🔍 Latest deploy log https://app.netlify.com/projects/vortexfi/deploys/6a1ff1966d10b00008a527ec
😎 Deploy Preview https://deploy-preview-1192--vortexfi.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

…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
Copilot AI changed the title [WIP] Fix code per review comments and add legacy timestamp handling fix: backwards-compat timestamp, safe eviction sort, aligned test batch size Jun 3, 2026
Copilot finished work on behalf of ebma June 3, 2026 09:19
Copilot AI requested a review from ebma June 3, 2026 09:19
@ebma ebma marked this pull request as ready for review June 3, 2026 09:25
@ebma ebma merged commit 45104d0 into staging Jun 3, 2026
8 checks passed
@ebma ebma deleted the copilot/fix-review-comments-legacy-handling branch June 3, 2026 09:27
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