Skip to content

fix(providers): support data URL icons - #9555

Merged
diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.50from
xz-dev:fix/provider-icon-data-urls
Aug 10, 2026
Merged

diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.50from
xz-dev:fix/provider-icon-data-urls

Conversation

@xz-dev

@xz-dev xz-dev commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • accept valid data:image/*;base64,... values for compatible-provider Icon URLs while preserving HTTP(S) support
  • use one shared validator in the API schema and Add/Edit provider modals
  • reject malformed, non-image, non-base64, oversized, and unsafe Icon URL values with an inline field error

Related Issues

Validation

Choose the change type and focused loop from the
Contribution Golden Path. The full unit suite,
Vitest, the 60% coverage gate, and the production build all run in CI on this PR (#8329):

  • Change type: provider / UI / i18n
  • Focused tests and category gates from the golden path
  • npm run lint (changed TypeScript files via ESLint; full lint runs in CI)
  • Reconciled with the current active release base; focused checks rerun afterward
  • Production-code changes include a new or updated automated test in this PR
  • SonarQube PR analysis is green or any remaining issues are explicitly documented below

Focused validation:

  • node --import tsx/esm --test tests/unit/provider-icon-url-validator.test.ts tests/unit/provider-node-icon-url.test.ts
  • npx vitest run tests/unit/ui/add-compatible-provider-icon-url.test.tsx tests/unit/ui/edit-compatible-node-icon-url.test.tsx
  • npm run typecheck:core
  • ESLint on all changed TypeScript/TSX files with --no-cache
  • npm run i18n:check
  • npm run i18n:check-ui-coverage
  • npm run i18n:check-value-drift
  • npm run i18n:check-glossary
  • Prettier check on all changed source, test, and locale files

Tests Added Or Updated

  • tests/unit/provider-icon-url-validator.test.ts
  • tests/unit/provider-node-icon-url.test.ts (existing route/DB coverage rerun)
  • tests/unit/ui/add-compatible-provider-icon-url.test.tsx
  • tests/unit/ui/edit-compatible-node-icon-url.test.tsx

Coverage Notes

The shared validator tests cover HTTP(S), case-insensitive data-URL metadata, MIME parameters, strict base64 validation, unsafe schemes, and independent HTTP/data size caps. Existing provider-node tests cover schema, route, and SQLite persistence. Add/Edit modal tests cover inline rejection and valid data-image submission.

Reviewer Notes

  • HTTP(S) URLs retain the existing 2,000-character limit.
  • Data image URLs use a separate 256 KiB text limit so realistic base64 icons are useful while remaining bounded.
  • No migration or dependency was added; the existing SQLite TEXT column stores the validated value unchanged.

@xz-dev
xz-dev requested a review from diegosouzapw as a code owner August 6, 2026 03:06
@xz-dev
xz-dev force-pushed the fix/provider-icon-data-urls branch from 43af7e0 to 3b44b54 Compare August 6, 2026 05:31
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks for the PR. Please address the mandatory items (tests and/or merge blockers) in this branch, then rerun checks before /merge-prs.

3 similar comments
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks for the PR. Please address the mandatory items (tests and/or merge blockers) in this branch, then rerun checks before /merge-prs.

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks for the PR. Please address the mandatory items (tests and/or merge blockers) in this branch, then rerun checks before /merge-prs.

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks for the PR. Please address the mandatory items (tests and/or merge blockers) in this branch, then rerun checks before /merge-prs.

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Obrigado pelo PR. Mantive a revisão de fix-in-place e não foi possível concluir o ajuste completo aqui:

  • Para os PRs em fork: não consigo aplicar push de correção diretamente na sua branch.
    Por favor, faça um rebase/sync com release/v3.8.50, resolva conflitos se houver, e rode os checks dessa branch.
    Se preferir, posso aplicar a correção na próxima rodada assim que você mandar o branch atualizado ou confirmar que o PR está limpo pra esse merge.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
@diegosouzapw
diegosouzapw force-pushed the fix/provider-icon-data-urls branch from 3b44b54 to a6d9687 Compare August 10, 2026 06:22
@diegosouzapw
diegosouzapw merged commit 2e6c151 into cheaper-inference:release/v3.8.50 Aug 10, 2026
2 of 5 checks passed
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…inference#9555)

Co-authored-by: xz-dev <xz-dev@users.noreply.github.com>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.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