Skip to content

fix(dashboard): hide disabled provider connections from combo builder - #6984

Merged
diegosouzapw merged 7 commits into
release/v3.8.49from
fix/port-pr-2526-hide-disabled-connections-combos
Jul 17, 2026
Merged

diegosouzapw merged 7 commits into
release/v3.8.49from
fix/port-pr-2526-hide-disabled-connections-combos

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

Summary

  • The combos page's fetchData() only filtered connections by last testStatus ("active"/"success"), so a connection the user explicitly disabled (isActive: false) could still appear as selectable in the combo builder if it retained a stale healthy testStatus from before it was disabled.
  • Added filterActiveConnections() in src/shared/utils/connectionStatus.ts and applied it before the existing testStatus filter in the combos page.

Attribution

Thanks to @attid for the original implementation.

Changes

  • src/shared/utils/connectionStatus.ts (new): filterActiveConnections() excludes connections with isActive === false.
  • src/app/(dashboard)/dashboard/combos/page.tsx: fetchData() now filters out disabled connections before the testStatus gate.
  • tests/unit/connection-status-filter-active-2526.test.ts (new): regression tests, including one that mirrors the exact combined filter used in the combos page.

Test plan

  • node --import tsx/esm --test tests/unit/connection-status-filter-active-2526.test.ts — verified fails without the fix (module missing) and passes with it
  • node --import tsx/esm --test tests/unit/combos-quota-protected.test.ts tests/unit/connection-status-filter-active-2526.test.ts — all green
  • npx eslint src/shared/utils/connectionStatus.ts "src/app/(dashboard)/dashboard/combos/page.tsx" tests/unit/connection-status-filter-active-2526.test.ts — clean
  • npm run typecheck:core — clean

The combos page's fetchData() only filtered available connections by
testStatus ("active"/"success"), so a connection the user had
explicitly disabled (isActive: false) could still show up in the
combo builder if it carried a stale testStatus from before it was
disabled.

Add filterActiveConnections() in src/shared/utils/connectionStatus.ts
and apply it ahead of the existing testStatus filter.

Co-authored-by: itolstov <attid0@gmail.com>
Inspired-by: decolua/9router#2526
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a shared utility filterActiveConnections to exclude explicitly disabled provider connections (where isActive === false) from the active providers list on the combos page, preventing stale test statuses from incorrectly keeping them active. It also adds corresponding unit tests. The review feedback correctly identifies a potential runtime TypeError in the utility's implementation: using optional chaining (connection?.isActive !== false) preserves nullish elements in the filtered array, which can crash downstream property accesses. A code suggestion was provided to explicitly filter out nullish elements.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/shared/utils/connectionStatus.ts Outdated
diegosouzapw and others added 2 commits July 12, 2026 20:54
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
@diegosouzapw
diegosouzapw changed the base branch from release/v3.8.47 to release/v3.8.48 July 13, 2026 05:04
@diegosouzapw
diegosouzapw changed the base branch from release/v3.8.48 to release/v3.8.49 July 13, 2026 21:57
@diegosouzapw

Copy link
Copy Markdown
Owner Author

PR #6984 — fix aprovado no probe TDD (fail-without-fix provado: sem o helper, o teste quebra por módulo ausente, exatamente como a descrição previu). ATENÇÃO — colisão real com #7118 (grupo G3c, 'include never-tested connections in combo builder'): os dois editam a MESMA linha do filtro active em combos/page.tsx::fetchData(). A função nova do #7118 (isEligibleActiveConnection) já inclui a mesma exclusão isActive===false que este PR adiciona, e ainda faz mais (relaxa o gate de testStatus pra conexão nunca testada). Recomendo mergear #7118 primeiro (é o superset) e então reavaliar se #6984 ainda agrega algo — provavelmente vira subsumido, porque isEligibleActiveConnection já cobre o caso que filterActiveConnections resolve. Se preferir mergear #6984 primeiro, #7118 vai precisar rebasear a substituição do filtro por cima do wrapper novo (conflito de merge textual esperado nas duas ordens).

diegosouzapw and others added 3 commits July 15, 2026 06:16
…-file

The combos page only filtered provider connections on testStatus, so a
connection the user had explicitly disabled survived with a stale
"active"/"success" status. The isActive + testStatus gate now lives in
the shared connectionStatus util as filterUsableConnections(), which the
page calls in a single line.

This keeps src/app/(dashboard)/dashboard/combos/page.tsx BELOW its frozen
file-size cap (4653 vs 4655 congelado — the file shrinks by 2 lines vs the
release tip) without touching config/quality/file-size-baseline.json, as
the gate asks ("modularize/extraia (DRY) para encolher").

The regression test now exercises filterUsableConnections directly instead
of hand-mirroring the page's filter chain, so it guards the real code path.

Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>
`connection?.isActive !== false` evaluated to true for null/undefined
entries, so nullish elements survived the filter. Callers read properties
off the result — filterUsableConnections() reads `connection.testStatus`
— which would throw "TypeError: Cannot read properties of null".

Guard with an explicit truthiness check. Covered by a test that fails
against the previous predicate.

Reported-by: gemini-code-assist
Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>
@diegosouzapw

Copy link
Copy Markdown
Owner Author

Babysit summary — CI green ✅

Final state: all 15 checks pass at cbf7393 (Fast Quality Gates, Unit Tests 4/4, Vitest, ESLint, Docs, Merge integrity, semgrep, dast-smoke). Handing off for human review & merge — not merged by this run.

# Red / finding Fix Why
1 Fast Quality Gates → check:test-discovery: orphan open-sse/translator/request/__tests__/openai-to-gemini.test.ts 8370eab — merged origin/release/v3.8.49 (branch was 57 commits behind) Base drift, not this PR. The file never existed on the release tip; #6943's relocation had already fixed it upstream. Also cleared the base-red Unit/Vitest failures (SQLITE_FULL + timeouts on the old runner).
2 Fast Quality Gates → check:file-size: combos/page.tsx 4656 > frozen 4655 291045c — extracted filterUsableConnections() into src/shared/utils/connectionStatus.ts; page calls it in one line Real, caused by this PR (+1 import line). Fixed the way the gate asks ("modularize/extraia (DRY) para encolher") — no file-size-baseline.json edit. The god-file now ends at 4653 vs 4655 frozen — 2 lines smaller than the release tip.
3 Review thread (gemini-code-assist, high): connection?.isActive !== false keeps nullish entries cbf7393 — explicit !!connection && guard Real bug, sharpened by fix #2: filterUsableConnections() reads connection.testStatus directly, so a nullish entry would throw TypeError: Cannot read properties of null. Thread replied + resolved.

Tests: 3 → 5 in tests/unit/connection-status-filter-active-2526.test.ts. No assertion weakened, removed, or skipped.

  • The combos page fetchData filter mirrors … test hand-copied the page's filter chain, so it could pass while the page broke. It now calls the real filterUsableConnections() the page invokes — same assertions, wider fixtures (added healthy-success + legacy-no-isActive).
  • Nullish guard verified failing-then-passing against the previous predicate (Hard Rule fix(ci): add environment for npm token access #18).

Gates run locally, all green: check:file-size, check:complexity-ratchets (complexity 2056/2056, cognitive 890/890 — both exactly at baseline, no cross-gate tradeoff), check:test-discovery, check:migration-numbering, typecheck:core, lint.

Nothing left needing an owner decision. Ready for human review & merge.

@diegosouzapw
diegosouzapw merged commit c46d35b into release/v3.8.49 Jul 17, 2026
15 checks passed
@diegosouzapw
diegosouzapw deleted the fix/port-pr-2526-hide-disabled-connections-combos branch July 19, 2026 21:01
@diegosouzapw diegosouzapw mentioned this pull request Jul 28, 2026
HouMinXi pushed a commit to HouMinXi/OmniRoute that referenced this pull request Aug 2, 2026
…diegosouzapw#6984)

* fix(dashboard): hide disabled provider connections from combo builder

The combos page's fetchData() only filtered available connections by
testStatus ("active"/"success"), so a connection the user had
explicitly disabled (isActive: false) could still show up in the
combo builder if it carried a stale testStatus from before it was
disabled.

Add filterActiveConnections() in src/shared/utils/connectionStatus.ts
and apply it ahead of the existing testStatus filter.

Co-authored-by: itolstov <attid0@gmail.com>
Inspired-by: decolua/9router#2526

* chore(changelog): fragment for diegosouzapw#6984

* fix(combos): keep combos page within frozen size cap

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>

* fix(combos): extract filterUsableConnections to shrink the combos god-file

The combos page only filtered provider connections on testStatus, so a
connection the user had explicitly disabled survived with a stale
"active"/"success" status. The isActive + testStatus gate now lives in
the shared connectionStatus util as filterUsableConnections(), which the
page calls in a single line.

This keeps src/app/(dashboard)/dashboard/combos/page.tsx BELOW its frozen
file-size cap (4653 vs 4655 congelado — the file shrinks by 2 lines vs the
release tip) without touching config/quality/file-size-baseline.json, as
the gate asks ("modularize/extraia (DRY) para encolher").

The regression test now exercises filterUsableConnections directly instead
of hand-mirroring the page's filter chain, so it guards the real code path.

Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>

* fix(combos): drop nullish entries in filterActiveConnections

`connection?.isActive !== false` evaluated to true for null/undefined
entries, so nullish elements survived the filter. Callers read properties
off the result — filterUsableConnections() reads `connection.testStatus`
— which would throw "TypeError: Cannot read properties of null".

Guard with an explicit truthiness check. Covered by a test that fails
against the previous predicate.

Reported-by: gemini-code-assist
Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>

---------

Co-authored-by: itolstov <attid0@gmail.com>
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…diegosouzapw#6984)

* fix(dashboard): hide disabled provider connections from combo builder

The combos page's fetchData() only filtered available connections by
testStatus ("active"/"success"), so a connection the user had
explicitly disabled (isActive: false) could still show up in the
combo builder if it carried a stale testStatus from before it was
disabled.

Add filterActiveConnections() in src/shared/utils/connectionStatus.ts
and apply it ahead of the existing testStatus filter.

Co-authored-by: itolstov <attid0@gmail.com>
Inspired-by: decolua/9router#2526

* chore(changelog): fragment for diegosouzapw#6984

* fix(combos): keep combos page within frozen size cap

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>

* fix(combos): extract filterUsableConnections to shrink the combos god-file

The combos page only filtered provider connections on testStatus, so a
connection the user had explicitly disabled survived with a stale
"active"/"success" status. The isActive + testStatus gate now lives in
the shared connectionStatus util as filterUsableConnections(), which the
page calls in a single line.

This keeps src/app/(dashboard)/dashboard/combos/page.tsx BELOW its frozen
file-size cap (4653 vs 4655 congelado — the file shrinks by 2 lines vs the
release tip) without touching config/quality/file-size-baseline.json, as
the gate asks ("modularize/extraia (DRY) para encolher").

The regression test now exercises filterUsableConnections directly instead
of hand-mirroring the page's filter chain, so it guards the real code path.

Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>

* fix(combos): drop nullish entries in filterActiveConnections

`connection?.isActive !== false` evaluated to true for null/undefined
entries, so nullish elements survived the filter. Callers read properties
off the result — filterUsableConnections() reads `connection.testStatus`
— which would throw "TypeError: Cannot read properties of null".

Guard with an explicit truthiness check. Covered by a test that fails
against the previous predicate.

Reported-by: gemini-code-assist
Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>

---------

Co-authored-by: itolstov <attid0@gmail.com>
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