fix(ci): unblock main — race in sse, lighthouse cert, e2e selectors - #345
Merged
Conversation
main ci has been failing since phase 0 tokenization (#338) merged. three independent root causes — none were phase-0 regressions but phase-0 was the first change broad enough to trip the path filters and surface them. backend (race detector): sse broadcaster's publish() released the read lock before sending, so a concurrent unsubscribe could close the channel between the "copy subs" snapshot and the send → write-on-closed-channel race. fix: hold the read lock across the (non-blocking, select-default) sends; the stalled-subscriber cleanup happens after the rlock is released so unsubscribe's write lock can proceed. e2e: - history-page "result snapshot or empty hint": locator `text=/...|history|.../` matched the sidebar "history" label first (hidden on mobile viewport) before reaching the main content. scope to the page section. - language-switch tests asserted on "test modules" / "módulos de prueba" but the i18n key common.sections.modules was never wired into any rendered ui — sidebar tests group was hardcoded `label: 'tests'`. wire sidebar via t() with defaultvalue fallback so existing display strings still work, set tests group label to the i18n key. now the marker actually renders, in both languages. lighthouse audit: treosh/lighthouse-ci-action was called with an inline urls: override but no configpath, so .lighthouserc.json's settings were ignored. workflow targets https://localhost:8444 (stem is https- only post-wave-1) with a mkcert dev cert that the ci runner does not trust → INSECURE_DOCUMENT_REQUEST / ERR_CERT_AUTHORITY_INVALID on every audit, blocking every release-please run for the past several merges. fix: add chromeflags (--ignore-certificate-errors --allow-insecure-localhost) to .lighthouserc.json settings and pass configpath: ./.lighthouserc.json so the action loads them. unblocks release-please for stem.
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
krisarmstrong
enabled auto-merge (squash)
May 27, 2026 20:27
Contributor
License Compliance ReportAll dependencies pass license compliance checksGo Dependencies
npm DependenciesSee full report in workflow artifacts Allowed Licenses: MIT, Apache-2.0, BSD-*, ISC, CC0-1.0, MPL-2.0 |
- Sidebar.tsx: biome format pass after the t() wrapping refactor
(re-indentation inside the new `=> { ... }` body)
- useLocale.test.ts: the two `biome-ignore lint/suspicious/noExplicitAny`
comments stopped suppressing anything after a biome upgrade — the
underlying `any` was already type-safe enough that biome no longer
flagged it. replace `as any` with explicit cast through
`UseTranslationResponse<...>['i18n'|'t']` and drop the dead
suppressions. tests still pass (3/3 in useLocale.test.ts).
Contributor
License Compliance ReportAll dependencies pass license compliance checksGo Dependencies
npm DependenciesSee full report in workflow artifacts Allowed Licenses: MIT, Apache-2.0, BSD-*, ISC, CC0-1.0, MPL-2.0 |
This was referenced Jul 8, 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.
Summary
Stem main CI has been failing since #338 (Phase 0 tokenization) merged. Three independent root causes — none were Phase-0 regressions, but Phase-0 was the first change broad enough to trip the path filters and surface them. Each blocked release-please from firing (workflow_run conclusion = failure ⇒ skip).
Backend (race detector)
SSEBroadcaster.Publish()released the read lock before sending. A concurrentunsubscribe()could close the channel between the snapshot and the send → write-on-closed-channel race that was tripped byTestSSEBroadcaster_ConcurrentSubscribePublish.Fix: hold the read lock across the (non-blocking,
select default) sends. Stalled-subscriber cleanup runs after the rlock releases so unsubscribe's write lock can proceed.E2E
locator('text=/...|history|.../')matched the sidebar "History" label first (hidden on mobile viewport) before reaching main content. Scoped the match to the page's<section>.common.sections.moduleswas never wired into any rendered UI — the sidebar Tests group was hardcodedlabel: 'Tests'. WiredSidebarto uset(label, { defaultValue: label })so existing display strings still work, then set Tests group label to the i18n key. Now the marker actually renders in both languages.Lighthouse
treosh/lighthouse-ci-actionwas invoked with inlineurls:override but noconfigPath, so.lighthouserc.jsonsettings were ignored. Workflow targetshttps://localhost:8444(stem is HTTPS-only post-Wave-1) with a mkcert dev cert that the CI runner doesn't trust →INSECURE_DOCUMENT_REQUEST/ERR_CERT_AUTHORITY_INVALIDon every audit, blocking every release-please run for the past several merges.Fix: add
chromeFlags: --ignore-certificate-errors --allow-insecure-localhostto.lighthouserc.jsonsettings, passconfigPath: ./.lighthouserc.jsonso the action loads them, and switch the config's example URLs from http → https to match.Test plan
go test -race -count=3 ./internal/api -run TestSSEBroadcaster— clean (3× iterations)npx tsc --noEmit— cleannpm run build— clean