Repository navigation
fix(web-shared): report failed blacklisted-domain config reads - #8328
Merged
Merged
Conversation
readBlacklistedDomains logs and captures the failure through the existing helpers, then rethrows so createCachedFetch keeps serving the last list it read successfully and retries after the shared failure backoff. Before the first successful read the BLACKLIST_DOMAINS value is still served. Tests cover a stored list, a failure after a good read, a failing first read, and an unreadable stored payload.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe change only adds failure reporting around the existing blacklist domain read; Notes
Files Reviewed (2 files)
Reviewed by deepseek-v4.1-flash-1017 · Input: 39.3K · Output: 10.1K · Cached: 693.2K Review guidance: REVIEW.md from base branch |
iscekic
enabled auto-merge
October 20, 2026 21:46
eshurakov
approved these changes
Oct 23, 2026
This was referenced Oct 24, 2026
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.
Change
Reading the operator-maintained domain list (
packages/web-shared/src/lib/blacklist-domains-config.ts)now reports a failed or unreadable read and keeps the last list it read successfully.
errorExceptInTestand callscaptureException(error, { tags: { source: 'blacklist_domains_config' } })when the read or thepayload is unusable, then rethrows.
createCachedFetchkeeps its contracts: the last successfully read list is served, concurrentcallers share one failed refresh, and the next attempt happens after the shared 30s failure
backoff (fix(web-shared): share in-flight fetches and back off failures in createCachedFetch #7881) instead of once per auth check.
BLACKLIST_DOMAINSvalue.isUserBlacklistedByDomainand the denial invalidateUserAuthorizationare not touched.Tests
packages/web-shared/src/lib/blacklist-domains-config.test.ts(new, runs under the web Jest config):BLACKLIST_DOMAINSservedpnpm --filter web exec jest --runInBand packages/web-shared/src/lib/blacklist-domains-config.test.ts→ 4 passed.pnpm --filter @kilocode/web-shared typecheckpasses.End-to-end evidence (local dev stack on this VM)
pnpm dev:start core(Next.js :3000, Postgres, redis, redis-http), two fake accounts seeded in thelocal database, a test-only domain in the local
admin:blacklisted-domainskey, Chromium through@playwright/test. The Redis read takes the same code path the app uses.(
/users/sign_in?error=BLOCKED, server logSECURITY: Blacklisted); the other account signs inand
GET /api/user→ 200.docker stop dev-redis-http-1, then past the 60s cache TTL: the listed-domain account is stilldenied (
?error=BLOCKED); the other account still signs in (/profile) andGET /api/user→ 200.dev/logs/nextjs.loggains[blacklist-domains] Failed to read the blacklisted domains: [TypeError: fetch failed] … ECONNREFUSED 127.0.0.1:8079.docker start dev-redis-http-1, past the backoff window: normal behavior, no new failure lines.gains the parse failure with its stack.
Limitation: Sentry delivery is not observable on the local stack (no DSN), so the unit test asserts
the
captureExceptioncall instead.Proxy answers
The owner's proxy gave these answers in the owner's place.
Answer: Serve env list, report failure
Confidence: 0.85 · Precedent: Fix the root cause on every affected surface (session 7f3470e0ba6f: "fix class of issue preventing progress"). The brief also says to return the BLACKLIST_DOMAINS list and report the failure before the first good read.
Answer: Keep the shared 30s backoff
Confidence: 0.65 · Precedent: Trust the code over documents, because documents can be stale (session 269375d6e466: "those documents may be stale, only trust code"). The fix(web-shared): share in-flight fetches and back off failures in createCachedFetch #7881 backoff landed after this item was filed and prevents amplification during an outage.
Answer: error ExceptInTest + captureException
Confidence: 0.80 · Precedent: Prefer existing libraries and patterns to hand-rolled code (session df491946927a: "we will try and use libraries wherever we can"). This matches custom-llm-catalog.ts and the brief's use of the existing logging and Sentry helpers.