[ENG-45620] fix: render and persist custom QUIC ports in workload protocol settings#3540
Open
gdsantana wants to merge 3 commits into
Conversation
Contributor
Author
|
Ainda deve ser validado porque não possivel configurar as portas de http3 |
9b97dcf to
b329f48
Compare
…renderizado-corretamente-ao-usar-valores-customizados
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.
Bug fix
What was the problem?
Workloads criados via API/CLI/Terraform com suporte a HTTP/3 e
quic_portsdiferente de443quebravam a tela de edição no Console:.valueemundefined.A causa raiz: o adapter usava
HTTP3_PORT_LIST_OPTIONS(uma lista fechada contendo apenas{ value: 443 }) como tabela de lookup. Quando a porta vinda da API não estava nessa lista,Array.prototype.findretornavaundefined, colapsando o valor tanto no load quanto no save (parseInt(undefined.value)→TypeError). O mesmo padrão estava emhttpPortsehttpsPorts.Expected behavior
A UI deve renderizar qualquer valor de QUIC port considerado válido pela API e preservar esse valor no round-trip de save, sem corromper o workload.
How was it solved
src/services/v2/workload/workload-adapter.jsmapPortToOption(port, options)que sintetiza{ name: String(port), value: port }quando a porta vinda da API não existe na lista de defaults, em vez de retornarundefined.transformLoadWorkloadetransformCachedWorkloadToEdit.convertPortsArrayToIntegersagora aceitanumberdireto ou{ value }, filtra entradas nulas e descartaNaN, eliminando oTypeErrorno save.src/views/Workload/FormFields/blocks/protocolSettingsBlock.vuemergePortOptions+ computedshttpPortOptions/httpsPortOptions/http3PortOptionsque injetam o valor corrente do form nas options doMultiSelect, garantindo que o chip seja renderizado mesmo quando a porta não está na lista padrão.disabled; apenas passa a exibir o valor real que veio da API.How to test
protocols.http.versionsincluindohttp3equic_portscustomizado (ex.:[9443]):{ "name": "test-http3-custom-quic-port", "active": true, "infrastructure": 1, "protocols": { "http": { "versions": ["http1", "http2", "http3"], "http_ports": [80], "https_ports": [443], "quic_ports": [9443] } } }9443(e não mais um campo vazio com cadeado).quic_portspermanece[9443]após o reload.quic_ports: [443]e confirme que o chip443 (Default)continua aparecendo e o save funciona normalmente.🤖 Generated with Claude Code