fix: melhora a formatação e tratamento de erros na função getExistingSourceIds#1494
Merged
DavidsonGomes merged 3 commits intoEvolutionAPI:developfrom May 23, 2025
Merged
fix: melhora a formatação e tratamento de erros na função getExistingSourceIds#1494DavidsonGomes merged 3 commits intoEvolutionAPI:developfrom
DavidsonGomes merged 3 commits intoEvolutionAPI:developfrom
Conversation
Contributor
Reviewer's GuideThis PR refactors getExistingSourceIds to dynamically construct SQL parameters and query strings to match placeholders, adds error logging and returns an empty Set instead of null to prevent TypeErrors, and cleans up redundant code in the delete history flow. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
Author
|
@sourcery-ai review |
Contributor
There was a problem hiding this comment.
Hey @KokeroO - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
src/api/integrations/chatbot/chatwoot/utils/chatwoot-import-helper.ts
Outdated
Show resolved
Hide resolved
KokeroO
commented
May 23, 2025
|
|
||
| this.deleteHistoryMessages(instance); | ||
| this.deleteRepositoryMessagesCache(instance); | ||
| return 0; |
Contributor
Author
There was a problem hiding this comment.
@oriondesign2015 Não tem porque ter return 0 aqui. Ninguém espera retorno de importHistoryMessages
Contributor
Author
|
@sourcery-ai resolve |
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.
Problema
Mesmo após as correções de #1493 e #1490, em certas ocasiões continuou o erro:
bind message supplies 2 parameters, but prepared statement "" requires 1Passou a ter o seguinte erro no banco de dados:
Error on import history messages: TypeError: Cannot read properties of null (reading 'has')Solução
hasnão lê valoresnull, então foi alterado a possibilidade de retorno do valornullem caso de acionamento do blococatchSummary by Sourcery
Fix parameter binding and error handling in getExistingSourceIds to prevent SQL parameter count mismatches and avoid returning null
Bug Fixes:
Enhancements:
Chores:
return 0after message deletion