Compare commits

...

2 Commits

Author SHA1 Message Date
0c1f08a9db Merge pull request 'more debug info' (#7) from dev into main
All checks were successful
Build && Deploy / cargo build (push) Successful in 52s
Reviewed-on: #7
2025-05-31 10:14:05 +00:00
Akulij
a47665c9c0 more debug info
Some checks failed
Build && Deploy / cargo build (push) Has been cancelled
2025-05-31 15:13:31 +05:00

View File

@ -29,6 +29,7 @@ pub fn attach_user_application(
let user_application = let user_application =
c.create_callback(move |q: OwnedJsObject| -> Result<_, ScriptError> { c.create_callback(move |q: OwnedJsObject| -> Result<_, ScriptError> {
println!("user_application is called");
let db = db.clone(); let db = db.clone();
let user: teloxide::types::User = match from_js(q.context(), &q) { let user: teloxide::types::User = match from_js(q.context(), &q) {
Ok(q) => q, Ok(q) => q,
@ -38,6 +39,7 @@ pub fn attach_user_application(
let application = futures::executor::block_on( let application = futures::executor::block_on(
Application::new(user.clone()).store_db(&mut db.write().unwrap()), Application::new(user.clone()).store_db(&mut db.write().unwrap()),
)?; )?;
println!("there1");
let db2 = db.clone(); let db2 = db.clone();
let msg = tokio::task::block_in_place(move || { let msg = tokio::task::block_in_place(move || {
@ -50,6 +52,7 @@ pub fn attach_user_application(
.await .await
}) })
}); });
println!("there2");
let msg = match msg { let msg = match msg {
Ok(msg) => msg, Ok(msg) => msg,
Err(err) => { Err(err) => {
@ -67,10 +70,12 @@ pub fn attach_user_application(
.answer("left_application_msg", None, None), .answer("left_application_msg", None, None),
) )
.unwrap(); .unwrap();
println!("there3");
futures::executor::block_on( futures::executor::block_on(
MessageForward::new(msg.chat.id.0, msg.id.0, chat_id, msg_id, false) MessageForward::new(msg.chat.id.0, msg.id.0, chat_id, msg_id, false)
.store_db(&mut db.write().unwrap()), .store_db(&mut db.write().unwrap()),
)?; )?;
println!("there4");
let ret = true; let ret = true;
Ok(ret) Ok(ret)