| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
- Ajustada a lógica de verificação para garantir que o ID da mensagem seja definido apenas quando disponível, evitando possíveis erros de referência. - Atualizada a definição do caminho de traduções para suportar a estrutura de diretórios em produção.
Reviewer's guide (collapsed on small PRs)
Reviewer's GuideAdds a guard in the Baileys message update handler to skip missing message records—preventing Prisma validation errors—and refactors the i18n initialization to dynamically resolve translation file paths for production and development environments. Sequence diagram for Baileys message update handler with missing message guardsequenceDiagram
participant BaileysService
participant Database
participant Prisma
BaileysService->>Database: Query for original message
Database-->>BaileysService: Return message (may be null)
alt Message found
BaileysService->>Prisma: Create MessageUpdate record
Prisma-->>BaileysService: Success
else Message not found
BaileysService->>BaileysService: Skip update, continue loop
end
Class diagram for i18n initialization and translation path resolutionclassDiagram
class ConfigService {
}
class I18n {
+languages: string[]
+translationsPath: string
+resources: any
}
I18n -- ConfigService: uses
I18n : +resolveTranslationsPath()
I18n : +initialize()
File-Level Changes
Possibly linked issues
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 there - I've reviewed your changes - here's some feedback:
Please address the comments from this code review:
## Overall Comments
- Consider logging a warning or info when skipping a message update due to a missing original message to aid debugging and monitoring.
- In the i18n initializer, verify the existence of the resolved translations directory (not just the ‘dist’ folder) before loading to avoid false positives when ‘dist’ exists but translations are missing.
Sorry, something went wrong.
- Implementada uma mensagem de aviso no serviço Baileys quando a mensagem original não é encontrada durante a atualização, melhorando a rastreabilidade de erros. - Ajustada a lógica de verificação do caminho de traduções para garantir que o diretório correto seja utilizado, com tratamento de erro caso não seja encontrado.
| Back | FazBrowse Home | New Git URL |
This pull request resolves two distinct issues to enhance application stability and ensure correct internationalization (i18n) in production environments. It addresses a critical Prisma validation error during message status updates and corrects a file path issue that prevented translation files from being loaded after the build process.
Fixes:
1. Prevent Prisma Validation Error on Message Updates:
2. Correct Dynamic Path for i18n Translations:
Enhancements:
Summary
This PR improves the application's reliability by fixing a critical crash in the Baileys message update handler and ensures proper localization in production by correcting the i18n module's translation file path.
Summary by Sourcery
Prevent message processing crashes by guarding missing records during updates and fix production i18n by resolving translation paths dynamically.
Bug Fixes:
Enhancements: