Skip to content

fix(subscription): serve last known good nodes instead of emptying the pool on fetch or parse failure - #14222

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.51from
maxmad64bis:fix/n104-ingest-lastgood
Sep 22, 2026
Merged

diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.51from
maxmad64bis:fix/n104-ingest-lastgood

Conversation

@maxmad64bis

@maxmad64bis maxmad64bis commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ base-red inherited: #13866

Summary

When a subscription source fails or returns an unrecognized format, the sync wipes the whole pool and drops the last known good nodes. Failed and invalid syncs now keep the persisted last known good nodes and leave every pool row untouched, while the subscription row itself still records the error.

Related Issues

Validation

  • Change type: provider
  • Focused tests and category gates from the golden path
  • npm run lint — targeted ESLint clean; full run is red on the base (same TS2677 pair, inherited, see Reviewer Notes)
  • Reconciled with the current active release base; focused checks rerun afterward
  • Production-code changes include a new or updated automated test in this PR

Tests Added Or Updated

  • tests/unit/proxySubscription.lastgood.test.ts (new, 4 cases: unrecognized content refused with recognized formats passing, fetch failure serving last nodes with pool untouched, invalid content refused before sync, repeated invalid syncs bumping the counter with pool intact)

Coverage Notes

  • src/lib/proxySubscription/subscriptionService.ts and src/lib/proxySubscription/parse.ts covered by the 4 new cases (real 127.0.0.1 servers through the fetch guard and retry path, no stubs); neighbors proxySubscription.service + proxySubscription.parse + proxy-subscription-sync-ownership (19 tests) stay green.

Reviewer Notes

  • The refusal triggers only on unrecognized content (format: "unknown"); every recognized format including an empty feed keeps the current path. The existing NO_USABLE_NODES error code is reused, no new i18n key. The bounded fetch retry is untouched, and tests use real 127.0.0.1 servers with no stubs.
  • Local gates: file-size OK, targeted ESLint clean, typecheck:core clean, new tests 4/4, neighbors 19/19.
  • CI reds are inherited from the red base (🔴 Release branch not green: release/v3.8.51 #13866), not from this diff: the third-party PR fix(sse): treat antigravity empty completions with a normal stop as valid 200s (#14160) #14243 on the same base release/v3.8.51 fails the same 9 jobs (API Route Typecheck, Docs Gates, Fast Quality Gates, Merge integrity, ESLint, Unit fast-path 1-4/4); every file cited by the failing gates is outside this diff. Non-blocking for this PR.

@maxmad64bis
maxmad64bis force-pushed the fix/n104-ingest-lastgood branch from d9cbdd2 to 663ad94 Compare September 19, 2026 22:58
@maxmad64bis
maxmad64bis marked this pull request as ready for review September 19, 2026 23:04
@diegosouzapw

Copy link
Copy Markdown
Owner

Thanks @maxmad64bis — merging via the release merge-train. Validated in local merge-train (mt-train10c) on the devbox @ train tip 4d841aa1c740bbaa03868dc0a403c62099a99a42 with the 72 sibling PRs of this batch: typecheck:core, file-size, complexity, cognitive-complexity, changelog-integrity green; changed-area node:test 831/831 (0 failing) and vitest 480/482 — the two reds are autoCombo/provider-family-combos.test.ts timing out at 20s, which reproduces on the PURE release tip under the full vitest suite (and is already tracked by the Release-Green issue #13866), so it is inherited, not this batch's. Merged --admin per merge-gates §3/§4/§7.

@diegosouzapw
diegosouzapw merged commit e4e41ac into diegosouzapw:release/v3.8.51 Sep 22, 2026
15 of 25 checks passed
@maxmad64bis
maxmad64bis deleted the fix/n104-ingest-lastgood branch September 24, 2026 21:13
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