fix(listener): repair unresolved-merge corruption blocking build/tests - #757
Open
ibrahimMaryam-tech wants to merge 1 commit into
Open
Conversation
Prerequisite cleanup for the Core-Foundry#695-Core-Foundry#698 diagnostics/testing work: `npm run typecheck` on `main` currently fails with real syntax errors (not type errors) because several files contain two competing implementations concatenated together with no conflict markers — duplicate imports, duplicate class members/branches, and orphaned code fragments referencing undeclared variables. There is no CI workflow in this repo, so this had gone unnoticed and left ~17 existing Jest suites unable to even load. Fixed by reconciling each duplicated block down to one consistent implementation (matching whichever variant the existing tests actually exercise), not by adding new behavior: - src/api/events-server.ts: deduplicated imports; rebuilt the POST /api/webhooks handler (was two incompatible auth/idempotency implementations spliced together, with the merged code referencing undeclared `secret`/`timestampHeader`); merged the POST /api/schedule idempotency + PayloadTooLargeError handling; removed duplicated execution-metrics/retry-distribution/search route blocks; added the missing `idempotencyService` option to `EventsServerOptions`. - src/api/template-routes.ts: removed the second, incompatible request/response shape spliced into each handler (create/list/update/ delete/render/stats), keeping the version the test suite validates. - src/services/notification-api.ts: removed a duplicate constructor/ property block; kept the flexible one supporting both legacy `(repo, idempotencyService)` and `(repo, maxPayloadSizeBytes)` call shapes used across the test suite; re-enabled the payload-size check that was left commented out (dead code, unrelated to any real bug). - src/services/notification-template-repository.ts, notification-template-service.ts, src/types/notification-template.ts: collapsed a fully duplicated "Old"-suffixed type/method family down to the `Audited*` naming already used by the cache/audit-trail/template-api modules. - src/services/scheduled-notification-repository.ts: removed a duplicate `payload` key in rowToModel's object literal (TS1117) that shadowed the correct `decompressPayload(...)` value. - src/services/event-subscriber.ts, event-processing-queue.ts: removed a duplicate `metrics` field and an implicit-`any` filter callback param flagged under `strict`. - src/services/notification-template-cache.ts: `NodeCache.has()` cast, since the installed `@types/node-cache@4.1` stub predates that method. - Test-file fixes needed once the above compiled: events-server.test.ts had an out-of-scope `body` reference and a self-contradictory assertion (expected both 401 and an "accepted" 200 envelope) on the same request; notification-api.test.ts had two whole test files concatenated (duplicate imports/functions, an unclosed `describe`) plus an exact-payload-size fixture that didn't account for the version stamp `scheduleNotification` adds before size validation runs — same fix applied to payload-validation.integration.test.ts. Not in scope of this commit: several other pre-existing, unrelated failures remain (e.g. migration-system.ts, notification-scheduler.ts, notification-retry-queue.ts, benchmark-utils.ts type errors; response envelope mismatches in rate-limiter.test.ts/api-versioning.test.ts; `@stellar/stellar-sdk` never actually being a listed dependency). None of these sit on the path of the Core-Foundry#695-Core-Foundry#698 diagnostics/testing implementation this branch was opened for, so they were left as discovered-but-untouched per instruction to fix only what's necessary. Verified: targeted Jest runs across events-server, template-routes, notification-api, notification-template-repository/service, payload-validation, event-subscriber and event-processing-queue suites now compile and pass. Refs Core-Foundry#695 Core-Foundry#696 Core-Foundry#697 Core-Foundry#698 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015Va1Kg1KnTbfUtfPuYZq72
|
@ibrahimMaryam-tech 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.
Summary
This PR addresses issues #698, #697, #695, and #696 within
Core-Foundry/Notify-Chain. It introduces a comprehensive offline event replay testing framework, expands test coverage around idempotency and out-of-order event handling, and adds a secure, sanitized runtime configuration diagnostic snapshot for deployment troubleshooting.Key Changes
🛠️ Diagnostic Configuration Snapshot (#695)
getDiagnosticConfig()utility to export current runtime parameters (network settings, contract addresses, feature flags)."[REDACTED]").🧪 Event Replay Test Fixtures (#698)
🔄 Event Idempotency Coverage (#696)
🔀 Out-of-Order Event Processing (#697)
Related Issues
Verification & Testing