| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…etro content é do tipo string nas chamadas de findBotByTrigger() em chatbot.controller.
Reviewer's Guide by SourceryThis pull request fixes a type mismatch error that occurs when sending a location. The degreesLatitude property, which is a float, was not being properly converted to a string before being passed to the findBotByTrigger() method, which expects a string. Sequence diagram for sending a locationsequenceDiagram
participant User
participant WhatsApp
participant getConversationMessage
participant chatbot.controller
User->>WhatsApp: Sends location
WhatsApp->>getConversationMessage: Receives message
activate getConversationMessage
getConversationMessage->>getConversationMessage: Converts degreesLatitude to string
getConversationMessage-->>WhatsApp: Returns message content
deactivate getConversationMessage
WhatsApp->>chatbot.controller: findBotByTrigger(content)
activate chatbot.controller
chatbot.controller-->>WhatsApp: Returns bot response
deactivate chatbot.controller
WhatsApp->>User: Sends bot response
File-Level Changes
Tips and commands Interacting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Sorry, something went wrong.
There was a problem hiding this comment.
Hey @ricocorreia1 - I've reviewed your changes - here's some feedback:
Overall Comments:
Sorry, something went wrong.
| extendedTextMessage: msg?.message?.extendedTextMessage?.text, | ||
| contactMessage: msg?.message?.contactMessage?.displayName, | ||
| locationMessage: msg?.message?.locationMessage?.degreesLatitude, | ||
| locationMessage: msg?.message?.locationMessage?.degreesLatitude.toString(), |
There was a problem hiding this comment.
suggestion (bug_risk): Potential runtime error if degreesLatitude is undefined.
The change directly invokes toString() on degreesLatitude even though safe chaining is applied up to that property. If degreesLatitude is ever undefined, this call could throw an error. Consider using optional chaining (e.g., msg?.message?.locationMessage?.degreesLatitude?.toString()) or providing a fallback to ensure robustness.
| locationMessage: msg?.message?.locationMessage?.degreesLatitude.toString(), | |
| locationMessage: msg?.message?.locationMessage?.degreesLatitude?.toString(), |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Quando envia uma localização, faz a conversão de degreesLatitude para string, o parametro content é do tipo string nas chamadas de findBotByTrigger() em chatbot.controller e degreesLatitude é do tipo float causando erro de tipagem de dados.
Summary by Sourcery
Bug Fixes: