Skip to content

feat: add multiple handlers support to TriggerProcessorService#132

Merged
LeonardoVieira1630 merged 43 commits into
feat/batch-operationsfrom
feat/multiple-handlers
Sep 3, 2025
Merged

feat: add multiple handlers support to TriggerProcessorService#132
LeonardoVieira1630 merged 43 commits into
feat/batch-operationsfrom
feat/multiple-handlers

Conversation

@LeonardoVieira1630
Copy link
Copy Markdown
Member

  • Change triggerHandlers to support arrays of handlers per trigger ID
  • Implement parallel execution of handlers using Promise.allSettled
  • Add result aggregation combining messageIds and using latest timestamp
  • Add fault-tolerant error handling that logs failures but doesn't break service
  • Throw error only when all handlers fail
  • Add comprehensive tests for multiple handler scenarios

LeonardoVieira1630 and others added 7 commits August 28, 2025 11:10
- Replace multiple parallel getWalletOwners calls with single getWalletOwnersBatch call
- Replace multiple shouldSend calls with single shouldSendBatch call
- Reduce API requests from O(n) to O(1) for n addresses and events
- Improve notification deduplication efficiency using batch operations
- Maintain same notification logic while significantly reducing network overhead

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add getWalletOwnersBatch mock method to SubscriptionClient test mocks
- Add shouldSendBatch mock method to SubscriptionClient test mocks
- Ensure test files compile with new batch method signatures
- Maintain test coverage for refactored batch processing functionality

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
LeonardoVieira1630 and others added 9 commits August 29, 2025 11:32
…ting_power_messages

Feat/add transaction link to voting power messages
- Modified Consumer App constructor to accept ENS resolver as parameter
- Updated index.ts to create and inject ENS resolver instance
- Enables easier testing by allowing mock injection

This change prepares the codebase for using mock ENS resolver in tests
to avoid async operations that continue after test teardown.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Created MockEnsResolverService that returns synchronous responses
- Avoids real network calls to ENS during tests
- Prevents async operations from continuing after test teardown

This mock resolves the issue where ENS resolution was causing
"import after Jest teardown" errors in integration tests.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Updated startTestApps to use MockEnsResolverService
- Fixed tsconfig to exclude test files from build
- Ensures all integration tests use mock instead of real ENS

This completes the fix for voting-power test interference issue.
All tests now pass consistently without async ENS operations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@LeonardoVieira1630 LeonardoVieira1630 merged commit fc3e9c7 into feat/batch-operations Sep 3, 2025
@LeonardoVieira1630 LeonardoVieira1630 deleted the feat/multiple-handlers branch September 3, 2025 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add multiple handlers support to TriggerProcessorService

2 participants