Repository navigation
fix: repair corrupted merges and restore green CI on main - #1550
Merged
Merged
Conversation
Restore identifiers and values mutated by corrupted merges and get the
migration layout policy passing again.
- config: restore TESTNET_NETWORK_PASSPHRASE ("Test SDF Network ;
September 2015"), drop references to undefined env keys
- env: restore DB_POOL_MAX / DB_IDLE_TIMEOUT_MS / DB_CONN_TIMEOUT_MS /
DB_USER, drop duplicate STELLAR_*_HORIZON_URL / *_VAULT_CONTRACT_ID keys,
restore safeParse error reporting
- feeBumper: revert the unwired, broken rewrite from #1539
- revert #1540 (mutated metrics test identifiers, NUL byte in a test,
deleted tests, conflict branch with no service support)
- migrations: drop the never-runnable 0026_add_developer_payout_address
(syntax error, unused) and the unused fee/fingerprint migrations;
renumber the remaining duplicate 0026/0027 files sequentially in merge
order; add missing rollback/destructive-approved markers
- services/billing: import logger; routes/billing: narrow repo type
- docs: restore mutated contract ids in network-configuration.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Revert #1543 (global request ID registry). It was merged without CI running, broke ten suites that build pg-mem/mock schemas without apis/usage_event_request_ids, and its own integration test failed. Its migration was added today and is removed; revenue_ledger_indexer moves to 0032. - idempotencySweeper test: drop duplicate __filename/import.meta use that cannot compile under CommonJS jest. - revenueLedgerIndexer test: give mocked events a stellarTxHash now that only confirmed charges are indexed, wait for the first query before releasing it, and use TIMESTAMPTZ for the pg-mem lease column. - reportExporter test: the CSV stream ends with a newline. - settlementStoreSchema test: settlement amounts are bigint units. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- indexRevenueLedgerEvent: use uncorrelated EXISTS/NOT EXISTS guards (same semantics) instead of selecting from usage_events in the insert. - Lease fallback (used only without advisory locks): take a free lease with a guarded UPDATE, else create the row with ON CONFLICT DO NOTHING, instead of ON CONFLICT DO UPDATE ... WHERE. - pg-mem harnesses: TIMESTAMPTZ for lease/retry columns compared to NOW(). - billing.units test schema: add deduction_status columns. - idempotencySweeper test: wait for the second postgres ready message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The indexer SQL from #1544 uses features pg-mem cannot emulate, so the database-backed indexer tests now use a testcontainers PostgreSQL (one database per harness). The pg-mem copy of the findUnindexed test is skipped with a pointer to that coverage. Make the sweeper time-budget test deterministic by driving performance.now(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 24, 2026
4 tasks
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.
Main has been red since #1525. Several merges (#1525, #1538, #1539, #1540) carried deliberately corrupted code (random character mutations, a NUL byte in a test, deleted tests, unwired half-features).
Fixes
src/config/index.ts: restoreTESTNET_NETWORK_PASSPHRASE = "Test SDF Network ; September 2015"; remove references to undefinedSTELLAR_*_REVENUE_POOL_CONTRACT_ID/STELLAR_*_USDC_CONTRACT_ID.src/config/env.ts: restoreDB_POOL_MAX,DB_IDLE_TIMEOUT_MS,DB_CONN_TIMEOUT_MS,DB_USER(matching.env.exampleand all consumers); remove duplicateSTELLAR_*_HORIZON_URL/STELLAR_*_VAULT_CONTRACT_IDkeys; restoresafeParseerror reporting; drop unused fee-abstraction keys.src/services/feeBumper.ts,prisma/schema.prisma: revert the broken, unwired rewrite from fix(fees): verify single-use payment before fee-bump signing #1539 (FEE_BUMPING_SECRET_KEYtypo, nonexistentsorobanData, bigint type break in the route).billingDelect*identifiers inbillingDeductMetrics.test.ts, NUL byte inbilling-index.test.ts, deleted tests inbilling-credits.test.ts, and aconflictbranch with no service support.src/services/billing.ts: missingloggerimport.src/routes/billing.ts: narrow repository type to the method actually used.docs/network-configuration.md: restore mutated contract ids..env.example: drop unused hard-codedREVENUE_POOL_CONTRACT_IDetc. from fix(settlement): submit revenue-pool distribute and confirm before completion #1525.Migrations
src/migrate.tsorders by numeric prefix and rejects duplicates, andscripts/migrationPolicy.ts(CI gate) requires unique, contiguous prefixes from 0022. All duplicate 0026/0027 files were added while main CI was red (the last green commit only had0026_forwarded_identity_replays, which keeps its number). Changes:0026_add_developer_payout_address.sql(AD COLUMNsyntax error, so it can never have run; column unused),0027_fee_abstraction_quotes.sqland0027_usage_events_request_fingerprint.sql(unused by code; both from the reverted PRs; both idempotentIF NOT EXISTSso any environment that applied them is unaffected).destructive-approvedmarkers.Integration fixes (tests had not run on main since #1525)
apis/usage_event_request_ids, and its own integration test failed. It should be re-landed with the test schemas updated.usageEventsRepository.pg.ts(Accrue revenue only after on-chain confirmation #1544):indexRevenueLedgerEventuses uncorrelated EXISTS guards (same semantics); the non-advisory lease fallback uses a guarded UPDATE thenINSERT ... ON CONFLICT DO NOTHINGinstead ofON CONFLICT DO UPDATE ... WHERE.revenueLedgerIndexer.test.ts: database tests now run on a testcontainers PostgreSQL (pg-mem cannot evaluate the Accrue revenue only after on-chain confirmation #1544 SQL); mocked events carrystellarTxHash; the shutdown test waits for the first query.findUnindexedRevenueLedgerEvents resolves developer ownership...inusageEventsRepository.pg.test.ts(pg-mem: "lookups on joins"). The same query is covered on real PostgreSQL inrevenueLedgerIndexer.test.ts.idempotencySweeper.test.ts: removed duplicate__filename/import.meta(cannot compile under CJS jest), wait for the second postgres ready message, and driveperformance.now()so the time-budget test is deterministic.billing.units.test.ts: addeddeduction_statuscolumns.reportExporter.test.ts: the CSV stream ends with a newline.settlementStoreSchema.test.ts: amounts are bigint units.🤖 Generated with Claude Code