-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to typeorm 0.3.x #45
Conversation
…{ id })` to `findOneByOrFail({ id })` * Add missing `where` key to `find()` args
lol tried running this and then
|
it's actually a virus, got all your passwords now. jk, that's weird, let me test it with a production build, I just tested it in dev mode and opened the PR to document the thing. |
|
nvm, actually it crash when selecting a thread 🫥 (platform loaded externally) |
its alright tho im using the dev environ w webpack to run this, no issues so far. |
The same tests are failing in
Gonna dig into this errors, but this is unrelated to the PR |
yep i described the issue here: https://linear.app/texts/issue/PLT-1033/whatsapp-sent-messages-arent-saved-in-db-before-return - a simple sleep fixes it |
In case anyone else want to test this, here is a build of this branch that can be easily installed: CMD + J > Install platform integrations > Manifest URL: |
# Conflicts: # src/api.ts
* Add `node` to `FullBaileysMessage` (message.original`) * When calling `fetchMessages` send a retry request for any message that was not decrypted before * Bump baileys
This now includes #47 (which was pointing to this branch). @KishanBagaria let me know if you're happy to merge this as well. |
yep hasn't broken for me yet |
Context
We've identified that often the cause of the "Waiting for this message" problem is an error when decrypting the message node and calling either to repository.decryptGroupMessage or repository.decryptMessage.
The actual error in this scenario is
The database connection is not open
.Both
decryptGroupMessage
anddecryptMessage
need to call the signal storage:The signal storage we're providing to Baileys is a backed by a typeorm sqlite database connection, therefore the actual error (
The database connection is not open
) comes fromplatform-whatsapp
->typeorm
->better-sqlite3
.Description
We still don't know the actual cause of the database connection not being initialized when baileys / libsignal need to talk to it. However typeorm 0.3.0 replaced the
Connection
abstraction with a newDataSource
class.This PR bumps typeorm from 0.2.41 to 0.3.17 with the hope that some of the latest changes in typeorm could help mitigate the db connection problem.
Even if this doesn't solve the problem described, given the amount of breaking changes in typeorm from 0.2.x to 0.3.x I do think it's worth it updating now to avoid problems in the future.
Summary of relevant changes:
Connection to DataSource
findOne({ id })
tofindOneBy({ id })
andfindOneOrFail({ id })
tofindOneByOrFail({ id })
where
key tofind()
argsfindOne
with a (mandatory) where clausedb.close
withds.destroy