question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sending photo does not work

See original GitHub issue

Hello, latest library version, the following code (also tried sendFile). Does not work. Sending regular text message is ok. It tries to upload, because I see 0 in log, it’s progress from onProgress.

  const toUpload = new CustomFile(
     "up.jpg",
     fs.statSync(filepath).size,
     filepath
  );

  const uploaded = await client.uploadFile({
     file: toUpload,
     onProgress: (progress) => console.log(progress),
  });

  const result = await client.invoke(
     new Api.messages.SendMedia({
        peer: "maxfrai",
        media: new Api.InputMediaUploadedPhoto({
           file: uploaded,
        }),
        message: "Hello there!",
        randomId: BigInt("-4151817774164"),
     })
  );

[2021-07-17T10:52:30.236Z] [DEBUG] - [Running gramJS version 1.7.15] [2021-07-17T10:52:30.243Z] [INFO] - [Connecting to 149.154.167.51:80/TCPFull…] [2021-07-17T10:52:30.243Z] [DEBUG] - [Connecting] [2021-07-17T10:52:30.278Z] [DEBUG] - [Finished connecting] [2021-07-17T10:52:30.279Z] [DEBUG] - [Connection success!] [2021-07-17T10:52:30.279Z] [DEBUG] - [Already have an auth key …] [2021-07-17T10:52:30.279Z] [DEBUG] - [Starting receive loop] [2021-07-17T10:52:30.280Z] [DEBUG] - [Receiving items from the network…] [2021-07-17T10:52:30.280Z] [DEBUG] - [Starting send loop] [2021-07-17T10:52:30.280Z] [DEBUG] - [Waiting for messages to send…false] [2021-07-17T10:52:30.280Z] [INFO] - [Connection to 149.154.167.51:80/TCPFull complete!] [2021-07-17T10:52:30.295Z] [DEBUG] - [Assigned msgId = 6985846556743718040 to InvokeWithLayer] [2021-07-17T10:52:30.295Z] [DEBUG] - [Encrypting 1 message(s) in 72 bytes for sending] [2021-07-17T10:52:30.299Z] [DEBUG] - [Encrypted messages put in a queue to be sent] [2021-07-17T10:52:30.299Z] [DEBUG] - [Waiting for messages to send…false] [2021-07-17T10:52:30.345Z] [DEBUG] - [Handling bad salt for message 6985846556743718040] [2021-07-17T10:52:30.345Z] [DEBUG] - [1 message(s) will be resent] [2021-07-17T10:52:30.345Z] [DEBUG] - [Receiving items from the network…] [2021-07-17T10:52:30.345Z] [DEBUG] - [Assigned msgId = 6985846556947718512 to InvokeWithLayer] [2021-07-17T10:52:30.345Z] [DEBUG] - [Encrypting 1 message(s) in 72 bytes for sending] [2021-07-17T10:52:30.347Z] [DEBUG] - [Encrypted messages put in a queue to be sent] [2021-07-17T10:52:30.348Z] [DEBUG] - [Waiting for messages to send…false] [2021-07-17T10:52:30.348Z] [DEBUG] - [Assigned msgId = 6985846556959718596 to MsgsAck] [2021-07-17T10:52:30.348Z] [DEBUG] - [Encrypting 1 message(s) in 36 bytes for sending] [2021-07-17T10:52:30.349Z] [DEBUG] - [Encrypted messages put in a queue to be sent] [2021-07-17T10:52:30.350Z] [DEBUG] - [Waiting for messages to send…false] [2021-07-17T10:52:30.395Z] [DEBUG] - [Handling container] [2021-07-17T10:52:30.395Z] [DEBUG] - [Handling new session created] [2021-07-17T10:52:30.395Z] [DEBUG] - [Handling acknowledge for 6985846556947718512] [2021-07-17T10:52:30.395Z] [DEBUG] - [Receiving items from the network…] [2021-07-17T10:52:30.523Z] [DEBUG] - [Handling RPC result for message 6985846556947718512] [2021-07-17T10:52:30.525Z] [DEBUG] - [Receiving items from the network…] [2021-07-17T10:52:30.526Z] [DEBUG] - [Assigned msgId = 6985846557671718488 to updates.GetState] [2021-07-17T10:52:30.526Z] [DEBUG] - [Encrypting 1 message(s) in 20 bytes for sending] [2021-07-17T10:52:30.527Z] [DEBUG] - [Encrypted messages put in a queue to be sent] [2021-07-17T10:52:30.527Z] [DEBUG] - [Waiting for messages to send…false] [2021-07-17T10:52:30.528Z] [DEBUG] - [Assigned msgId = 6985846557675718200 to MsgsAck] [2021-07-17T10:52:30.529Z] [DEBUG] - [Encrypting 1 message(s) in 60 bytes for sending] [2021-07-17T10:52:30.529Z] [DEBUG] - [Encrypted messages put in a queue to be sent] [2021-07-17T10:52:30.530Z] [DEBUG] - [Waiting for messages to send…false] [2021-07-17T10:52:30.657Z] [DEBUG] - [Handling RPC result for message 6985846557671718488] [2021-07-17T10:52:30.658Z] [DEBUG] - [Receiving items from the network…] [2021-07-17T10:52:30.671Z] [DEBUG] - [Borrowing client for DC 1] [2021-07-17T10:52:30.672Z] [DEBUG] - [Getting DC 1] [2021-07-17T10:52:30.672Z] [DEBUG] - [Assigned msgId = 6985846558255718124 to help.GetConfig] [2021-07-17T10:52:30.672Z] [DEBUG] - [Encrypting 1 message(s) in 20 bytes for sending] [2021-07-17T10:52:30.673Z] [DEBUG] - [Encrypted messages put in a queue to be sent] [2021-07-17T10:52:30.673Z] [DEBUG] - [Waiting for messages to send…false] [2021-07-17T10:52:30.673Z] [DEBUG] - [Assigned msgId = 6985846558259718788 to MsgsAck] [2021-07-17T10:52:30.673Z] [DEBUG] - [Encrypting 1 message(s) in 36 bytes for sending] [2021-07-17T10:52:30.674Z] [DEBUG] - [Encrypted messages put in a queue to be sent] [2021-07-17T10:52:30.674Z] [DEBUG] - [Waiting for messages to send…false] [2021-07-17T10:52:30.796Z] [DEBUG] - [Handling RPC result for message 6985846558255718124] [2021-07-17T10:52:30.796Z] [DEBUG] - [Receiving items from the network…] [2021-07-17T10:52:30.797Z] [INFO] - [Connecting to 149.154.175.55:443/TCPFull…] [2021-07-17T10:52:30.797Z] [DEBUG] - [Connecting] [2021-07-17T10:52:30.834Z] [DEBUG] - [Finished connecting] [2021-07-17T10:52:30.834Z] [DEBUG] - [Connection success!] [2021-07-17T10:52:30.834Z] [DEBUG] - [Already have an auth key …] [2021-07-17T10:52:30.834Z] [DEBUG] - [Starting receive loop] [2021-07-17T10:52:30.834Z] [DEBUG] - [Receiving items from the network…] [2021-07-17T10:52:30.834Z] [DEBUG] - [Starting send loop] [2021-07-17T10:52:30.834Z] [DEBUG] - [Waiting for messages to send…false] [2021-07-17T10:52:30.834Z] [INFO] - [Connection to 149.154.175.55:443/TCPFull complete!] 0 [2021-07-17T10:52:30.836Z] [DEBUG] - [Assigned msgId = 6985846558907718552 to upload.SaveFilePart] [2021-07-17T10:52:30.836Z] [DEBUG] - [Encrypting 1 message(s) in 131108 bytes for sending] [2021-07-17T10:52:30.866Z] [DEBUG] - [Encrypted messages put in a queue to be sent] [2021-07-17T10:52:30.866Z] [DEBUG] - [Waiting for messages to send…false] [2021-07-17T10:52:31.701Z] [INFO] - [Broken authorization key; resetting] [2021-07-17T10:52:37.691Z] [DEBUG] - [Handling update UpdateShort] [2021-07-17T10:52:37.691Z] [DEBUG] - [Receiving items from the network…] [2021-07-17T10:52:41.307Z] [DEBUG] - [Handling update UpdateShort] [2021-07-17T10:52:41.308Z] [DEBUG] - [Receiving items from the network…]

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
painorcommented, Jul 17, 2021

Did you remove the session string ? needs a clean session

1reaction
painorcommented, Jul 17, 2021

i’ll roll out a fix in 5 min to npm

Read more comments on GitHub >

github_iconTop Results From Across the Web

8 Solutions to Fix iPhone Won't Send Pictures - iMobie
If your iPhone is connected to Wi-Fi and pictures are not sending, go to Settings > Wi-Fi and turn off Wi-Fi. Then you...
Read more >
Top 6 Ways to Fix iPhone Not Sending Pictures Issues
Top 6 Ways to Fix iPhone Not Sending Pictures Issues · 1. Send to Another Contact · 2. Check Internet Connection · 3....
Read more >
My iPhone Won't Send Pictures! Here's The Real Fix.
If your iPhone won't send pictures when it's not connected to Wi-Fi, go somewhere that has Wi-Fi, connect to the Wi-Fi network in...
Read more >
How to Fix iPhone Not Sending Photos Issue - Techbout
iPhone Is Not Sending Photos · 1. Restart iPhone · 2. Enable Cellular Data · 3. Check Network Strength · 4. Make Sure...
Read more >
iPhone not sending picture messages? How to fix it!
To fix iPhone not sending picture messages, 1. Restart your iPhone 2. Try Sending it to another contact 3. Enable MMS for Message...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found