Skip to content
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

Automatic Close DB after send Message #2881

Closed
Mashi-91 opened this issue May 13, 2024 · 8 comments
Closed

Automatic Close DB after send Message #2881

Mashi-91 opened this issue May 13, 2024 · 8 comments

Comments

@Mashi-91
Copy link

[ 3][t 1][1715577124.462336063][TdDb.cpp:286][#1][!RunOnSchedulerWorker] Close all databases
[ 4][t 1][1715577124.463069200][MultiPromise.cpp:15][#1][!RunOnSchedulerWorker] Add promise #1 to TdDbCloseMultiPromiseActor
[ 4][t 1][1715577124.463086128][MultiPromise.cpp:30][#1][!RunOnSchedulerWorker] Get promise #1 for TdDbCloseMultiPromiseActor
[ 4][t 1][1715577124.463090896][MultiPromise.cpp:30][#1][!RunOnSchedulerWorker] Get promise #2 for TdDbCloseMultiPromiseActor
[ 3][t 1][1715577124.463093757][FileDb.cpp:69][#1][!FileDbActor] FileDb is closed
[ 4][t 1][1715577124.463126182][MultiPromise.cpp:30][#1][!RunOnSchedulerWorker] Get promise #3 for TdDbCloseMultiPromiseActor
[ 4][t 1][1715577124.463130235][MultiPromise.cpp:30][#1][!RunOnSchedulerWorker] Get promise #4 for TdDbCloseMultiPromiseActor
[ 4][t 1][1715577124.463132858][MultiPromise.cpp:30][#1][!RunOnSchedulerWorker] Get promise #5 for TdDbCloseMultiPromiseActor
[ 4][t 1][1715577124.463135957][MultiPromise.cpp:30][#1][!RunOnSchedulerWorker] Get promise #6 for TdDbCloseMultiPromiseActor
[ 4][t 1][1715577124.463197231][MultiPromise.cpp:30][#1][!RunOnSchedulerWorker] Get promise #7 for TdDbCloseMultiPromiseActor
[ 4][t 1][1715577124.463200092][Binlog.cpp:421][#1][!Binlog C:\Users\user\OneDrive\Documents\CloudInfinity\td.binlog] Flush binlog from close
[ 4][t 1][1715577124.463204383][BufferedFd.h:140][#1][!Binlog C:\Users\user\OneDrive\Documents\CloudInfinity\td.binlog] Nothing to write to [fd:00000000000007A0]
[ 4][t 1][1715577124.463200092][Binlog.cpp:421][#1][!Binlog C:\Users\user\OneDrive\Documents\CloudInfinity\td.binlog] Flush binlog from close
[ 4][t 1][1715577124.463204383][BufferedFd.h:140][#1][!Binlog C:\Users\user\OneDrive\Documents\CloudInfinity\td.binlog] Nothing to write to [fd:00000000000007A0]
[ 3][t 1][1715577124.463209867][Binlog.cpp:410][#1][!Binlog C:\Users\user\OneDrive\Documents\CloudInfinity\td.binlog] Sync binlog from close
[ 3][t 1][1715577124.464155435][ConcurrentBinlog.cpp:25][#1][!Binlog C:\Users\user\OneDrive\Documents\CloudInfinity\td.binlog] Finished to close binlog
[ 4][t 1][1715577124.464671611][MultiPromise.cpp:36] Receive result #1 out of 7 for TdDbCloseMultiPromiseActor
[ 4][t 1][1715577124.464680910][MultiPromise.cpp:36] Receive result #2 out of 7 for TdDbCloseMultiPromiseActor
[ 4][t 1][1715577124.464682579][MultiPromise.cpp:36] Receive result #3 out of 7 for TdDbCloseMultiPromiseActor
[ 4][t 1][1715577124.464683771][MultiPromise.cpp:36] Receive result #4 out of 7 for TdDbCloseMultiPromiseActor
[ 4][t 1][1715577124.464684963][MultiPromise.cpp:36] Receive result #5 out of 7 for TdDbCloseMultiPromiseActor
[ 4][t 1][1715577124.464686155][MultiPromise.cpp:36] Receive result #6 out of 7 for TdDbCloseMultiPromiseActor
[ 4][t 1][1715577124.464687108][MultiPromise.cpp:36] Receive result #7 out of 7 for TdDbCloseMultiPromiseActor
[ 4][t 1][1715577124.464689254][MultiPromise.cpp:60] Set result for 1 promises in TdDbCloseMultiPromiseActor
[ 3][t 1][1715577124.464905023][SqliteConnectionSafe.cpp:39] Close SQLite database [path:C:\Users\user\OneDrive\Documents\CloudInfinity\db.sqlite]
[ 4][t 5][1715577124.467805862][Td.cpp:3187][#1][!Td] Decrease reference count to 0
[ 3][t 5][1715577124.467827320][Td.cpp:4034][#1][!Td][&td_requests] Sending update: updateAuthorizationState {
authorization_state = authorizationStateClosed {
}
}
[ 3][t 5][1715577124.467834711][Td.cpp:3279][#1][!Td] Stop Td
[ 3][t 0][1715577124.467859983][Client.cpp:293][&td_requests] End to wait for updates, returning object 0 000001E327E61E20
[ 3][t 0][1715577124.467870235][Client.cpp:280][&td_requests] Begin to wait for updates with timeout 0.100000
[ 3][t 0][1715577124.467951774][Client.cpp:293][&td_requests] End to wait for updates, returning object 0 0000000000000000

@levlam
Copy link
Contributor

levlam commented May 13, 2024

TDLib instance can't close by itself. You call close somewhere, or exit the app completely.

@Mashi-91

This comment was marked as off-topic.

@levlam
Copy link
Contributor

levlam commented May 13, 2024

You can find in the TDLib's log the exact close request that caused close of the TDLib instance.

@Mashi-91
Copy link
Author

I am actually sending message and its working but after send it stop

@levlam
Copy link
Contributor

levlam commented May 14, 2024

Reference to the TDLib instance is lost, which makes impossible to send further requests and hence forces the instance to close. I added more logging during instance creation and closing in the latest commit in master branch, which can help to find the cause.

@Mashi-91
Copy link
Author

Mashi-91 commented May 14, 2024

bro i am actually using this package https://github.com/ivk1800/tdlib-dart
cause i am in flutter. so if u tell me how i can use ur package in flutter so go ahead it would really helpful

@levlam
Copy link
Contributor

levlam commented May 14, 2024

The package uses the old TDLib JSON interface, therefore it can close TDLib instance by calling to td_json_client_destroy. The package seems to call it only if the app explicitly calls Client.destroy() and in https://github.com/ivk1800/tdlib-dart/blob/6760ab3f050f1a83e7f900de2da193f4b708f3ed/lib/src/client/platform/io/io_platform.dart#L31.

@Mashi-91
Copy link
Author

thnx brother. it would really helpfull. tell me if u need anyhelp. i am available😅.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants