Conversation
The frontend was failing to communicate with the backend in development because it was constructing an absolute URL for API requests, bypassing the Vite proxy.
This change modifies the `getApiUrl` function in `src/config/api.ts` to return a relative path ('') in development mode. This ensures all API and WebSocket requests are correctly proxied by the Vite dev server, resolving the connection and CORS issues.
The React UI tests were failing in environments with older Node.js versions due to the use of `crypto.randomUUID()`, which is not universally available. This commit replaces the call to `crypto.randomUUID()` in `src/services/testService.ts` with `uuidv4()` from the `uuid` library. The `uuid` library and its types have been added to the project dependencies. This ensures compatibility and allows the UI tests to run correctly across different development environments.
Guia do Revisor (colapsado em PRs pequenos)Guia do RevisorEste PR simplifica a configuração da URL da API do frontend, removendo a ramificação baseada no ambiente para sempre usar um caminho relativo, muda a geração de UUID no serviço de teste para a biblioteca uuid e atualiza as dependências de acordo. Diagrama de Classe para atualização da geração de UUID do TestServiceclassDiagram
class TestService {
+runTest()
}
TestService --> uuidv4 : uses
class uuidv4 {
<<function>>
}
Alterações a Nível de Arquivo
Dicas e comandosInteragindo com o Sourcery
Personalizando Sua ExperiênciaAcesse seu painel para:
Obtendo Ajuda
Original review guide in EnglishReviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR simplifies the frontend API URL configuration by removing environment-based branching to always use a relative path, switches UUID generation in the test service to the uuid library, and updates dependencies accordingly. Class diagram for TestService UUID generation updateclassDiagram
class TestService {
+runTest()
}
TestService --> uuidv4 : uses
class uuidv4 {
<<function>>
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Olá - Revisei suas alterações e elas parecem ótimas!
Sourcery é gratuito para código aberto - se você gosta de nossas revisões, considere compartilhá-las ✨
Original comment in English
Hey there - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Pull Request
Summary
Changes Made
Type of Change
Affected Services
Testing
Test Evidence
Checklist
Breaking Changes
Additional Notes
Resumo por Sourcery
Retornar URLs de API relativas para todos os ambientes e unificar a geração de UUID usando o pacote
uuidMelhorias:
crypto.randomUUIDporuuidv4para IDs de execução e adicionaruuide seus tipos como dependênciasOriginal summary in English
Summary by Sourcery
Return relative API URLs for all environments and unify UUID generation using the uuid package
Enhancements: