Feature/indexer start ledger#176
Open
oluwaseyi1996-netizen wants to merge 4 commits intoritik4ever:mainfrom
Open
Feature/indexer start ledger#176oluwaseyi1996-netizen wants to merge 4 commits intoritik4ever:mainfrom
oluwaseyi1996-netizen wants to merge 4 commits intoritik4ever:mainfrom
Conversation
- Add sendError helper function to apiErrors.ts for consistent error handling - Fix incomplete error handlers in auth endpoints - Replace all direct res.status().json() error responses with sendApiError calls - Ensure all 4xx and 5xx responses include requestId for log correlation - Remove duplicate imports in index.ts - Fix duplicate variable declarations in start-time endpoint Fixes ritik4ever#154
- Add documentation comments to clarify requestId usage in error responses - Enhance requestLogger middleware comments for log correlation - Ensure all error responses include requestId via existing helper functions - All 4xx/5xx responses now consistently include requestId for log correlation Fixes ritik4ever#154
- Update getStreamHistory function to accept limit and offset parameters - Add countStreamEvents function to get total count for pagination metadata - Update /api/streams/:id/history endpoint to support ?limit and ?offset query params - Add validation: default limit 50, max limit 200 - Response includes total count alongside paginated data array - Fixes ritik4ever#143
- Add INDEXER_START_LEDGER environment variable support - Override cursor in initIndexer() when environment variable is set - Log warning when override is active - Handle special case where INDEXER_START_LEDGER=0 (use saved cursor or latest) - Useful for redeploying contracts and forcing backfill from specific ledger Fixes ritik4ever#150
|
@oluwaseyi1996-netizen is attempting to deploy a commit to the ritik4ever's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@oluwaseyi1996-netizen Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Closes #150
mplementation Summary
Changes Made to backend/src/services/indexer.ts:
Added environment variable support: Introduced INDEXER_START_LEDGER environment variable reading in initIndexer()
Cursor override logic: Modified the cursor initialization in indexEvents() to use the environment variable when set (except when set to 0)
Warning logging: Added a warning log when the override is active (when INDEXER_START_LEDGER ≠ 0)
Special case handling: When INDEXER_START_LEDGER=0, the system uses the saved cursor or latest ledger (normal behavior)
Error handling: Added validation for invalid numeric values
Key Features
Environment Variable: INDEXER_START_LEDGER read at initIndexer()
Cursor Reset: If set, cursor resets to this value on startup
Warning Log: Logs warning when override is active
Zero Handling: INDEXER_START_LEDGER=0 means "use saved cursor or latest ledger"
Use Case: Perfect for redeploying contracts and forcing backfill from specific ledger
Branch and PR
Branch: feature/indexer-start-ledger has been created and pushed
Pull Request: Ready to create at https://github.com/oluwaseyi1996-netizen/stellar-stream/pull/new/feature/indexer-start-ledger
The implementation meets all acceptance criteria for issue #150 and provides the operational tooling needed for Wave 4.
closes#150