Skip to content

Conversation

@ebma
Copy link
Member

@ebma ebma commented Jan 16, 2026

This pull request introduces a new ramp processing context system using AsyncLocalStorage to automatically propagate rampId throughout asynchronous call chains. The main goal is to improve logging and error tracking by ensuring every log message and error handler can access the relevant rampId without explicitly passing it around. This change affects ramp processing, cleanup, and recovery workflows, as well as the logger output format.

The logs now include the rampId when available/applicable, see for example:

[backend] [Jan 16, 2026 16:05:09] info  [c71997a6-11bb-43df-a8d9-b717259c53ba] Processing state c71997a6-11bb-43df-a8d9-b717259c53ba with handler MoonbeamPostProcessHandler
[backend] [Jan 16, 2026 16:05:10] error  [6b579d5e-63f1-48dd-bc8a-7dcce4568166] Cleanup phase 'moonbeamCleanup' failed: Moonbeam cleanup failed: RpcError: 1010: Invalid Transaction: Transaction has a bad signature

@netlify
Copy link

netlify bot commented Jan 16, 2026

Deploy Preview for vortexfi ready!

Name Link
🔨 Latest commit a690585
🔍 Latest deploy log https://app.netlify.com/projects/vortexfi/deploys/696a6b7b4a10a30008948624
😎 Deploy Preview https://deploy-preview-1015--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.

@netlify
Copy link

netlify bot commented Jan 16, 2026

Deploy Preview for vortex-sandbox ready!

Name Link
🔨 Latest commit a690585
🔍 Latest deploy log https://app.netlify.com/projects/vortex-sandbox/deploys/696a6b7bafc62300082850d6
😎 Deploy Preview https://deploy-preview-1015--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.

@ebma ebma requested review from a team and Copilot January 16, 2026 16:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request introduces an AsyncLocalStorage-based ramp processing context system to automatically propagate rampId throughout asynchronous operations, improving logging and error tracking capabilities. The system eliminates the need to explicitly pass rampId through function parameters by making it available via context in all nested async operations.

Changes:

  • Added a new ramp-context.ts module implementing AsyncLocalStorage for ramp context management
  • Modified logger format to automatically include rampId from context when available
  • Wrapped ramp processing entry points with runWithRampContext in phase processor, recovery worker, and cleanup worker

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
apps/api/src/config/ramp-context.ts New module implementing AsyncLocalStorage for automatic rampId propagation through async call chains
apps/api/src/config/logger.ts Updated logger format to retrieve and display rampId from context, and applied custom format to console transport
apps/api/src/api/workers/ramp-recovery.worker.ts Wrapped recovery operations with runWithRampContext and removed explicit rampId from log messages
apps/api/src/api/workers/cleanup.worker.ts Wrapped cleanup operations with runWithRampContext to provide context for post-processing handlers
apps/api/src/api/services/phases/phase-processor.ts Wrapped main processRamp method with runWithRampContext to establish context for entire phase processing flow

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ebma
Copy link
Member Author

ebma commented Jan 16, 2026

@copilot please address the remaining open suggestions of this thread ie your last review in a separate PR targeting this branch.

Copy link
Contributor

Copilot AI commented Jan 16, 2026

@ebma I've opened a new pull request, #1016, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 3 commits January 16, 2026 16: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