Giter VIP home page Giter VIP logo

Comments (10)

volodalexey avatar volodalexey commented on June 22, 2024

Also following might be related to this issue:
If I switch off Wi-Fi(internet) on my smartphone => add a couple of messages => switch Wi-Fi(internet) => messages are sending to my Telegram bot (which is always run on VPS server).
Result the same:

bot freezes itself and refuses to work futher. I do not see any error messages, and I do not see any update events in console too. Only restart bot helps..

from airgram.

esindger avatar esindger commented on June 22, 2024

I couldn't reproduce this issue. Bot keeps to receive updates when I pin or unpin messages. Can you create a repository with simple code which reproduce this behavior?

from airgram.

volodalexey avatar volodalexey commented on June 22, 2024

Checked this again - I can reproduce the issue.
https://github.com/volodalexey/airgram-user-and-bot-test - updated repo.
Just setup the project (see README).
Then npm run build
Then npm run test and within 20 seconds try to pin some message in your test group (I pin message as a user from my Android smartphone)

from airgram.

volodalexey avatar volodalexey commented on June 22, 2024

@esindger have you managed to reproduce this?

Bot keeps to receive updates

Yes looks like bot receives updates, however NewMessageUpdate is never generated after I pin message.
I connected airgram-debug to se the difference in two cases:
1 => start bot => user send "/start" => bot receive NewMessageUpdate => bot reply
2 => start bot => userpin some message => user send "/start" => bot freeze
And I see that in 1 case I get NewMessageUpdate, in 2 no.
I found difference in output here (maybe this will help):
1:

...
airgram verbose 14:48:57.243 [UpdatesHandler] [3] handle() "updateNewMessage" ...
updates.use // my output in console
updates.on // my output in console
airgram info    14:48:57.249 [Client] callApi() "messages.sendMessage" ... // bot sends response
...

2:

...
airgram verbose 14:49:15.620 [UpdatesHandler] [3] handle() "updateNewMessage" ...
airgram verbose 14:49:15.621 [UpdatesHandler] [3] handleUpdateState() detected a pts hole (17292 > 17294 + 1), wait for true pts +1ms
airgram verbose 14:49:15.621 [Updates] [5] handled "updates" for 0.003sec +0ms
airgram verbose 14:49:16.120 [MtpClient][1] sendLongPoll() call checkLongPoll() +499ms
airgram verbose 14:49:16.121 [MtpClient][1] checkLongPoll() send longPoll +1ms
airgram debug   14:49:16.121 [MtpSerializer] writeInt() 2459514271  2459514271 http_wait[id]:int +1ms
airgram debug   14:49:16.122 [MtpSerializer] writeInt() 500  500 http_wait[max_delay]:int +0ms
airgram debug   14:49:16.122 [MtpSerializer] writeInt() 150  150 http_wait[wait_after]:int +0ms
airgram debug   14:49:16.123 [MtpSerializer] writeInt() 25000  25000 http_wait[max_wait]:int +1ms
...

from airgram.

volodalexey avatar volodalexey commented on June 22, 2024

What do I need to pull new version of airgram? I do not see any version change.

from airgram.

volodalexey avatar volodalexey commented on June 22, 2024

I checked 0.1.14 and now bot works, however after "pin" => if user send some message => in bot I get this message without parent context (ctx.parent is undefined), and hense I can not detect some useful information.
Is there something I can do with this?

from airgram.

 avatar commented on June 22, 2024

Please check 0.1.15 version.

from airgram.

volodalexey avatar volodalexey commented on June 22, 2024

Checked with version 0.1.15 - I still can not get parent context after pin.
Next message event after pin does not have parent context.

from airgram.

volodalexey avatar volodalexey commented on June 22, 2024

Sorry, problem is not in parent context. Will reply shortly.

from airgram.

volodalexey avatar volodalexey commented on June 22, 2024

Ok. It works. Awesome!
I had to take into account that after pin I will receive two messages:

{ _: 'updateNewMessage',
  message:
   { _: 'messageService',
     ...
     action: { _: 'messageActionPinMessage' } },
  pts: 18881,
  pts_count: 0 }

{ _: 'updateNewMessage',
  message: { _: 'message', ... },
  pts: 18886,
  pts_count: 1 }

from airgram.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.