enricostara / telegram-mt-node

Telegram MTProto library (javascript, node.js)
MIT License
77 stars 25 forks source link

Stack size exceeded #9

Closed badoualy closed 9 years ago

badoualy commented 9 years ago

Hi,

tried to getHistory for a given chat, got the following :

undefined:87
    this.readBytes = function readBytes() {
                                       ^
RangeError: Maximum call stack size exceeded
    at readBytes (eval at createConstructor (c:\Users\Yann\Desktop\telegram\node_modules\telegram.link\node_modules\telegram-tl-node\lib\builder\constructor-builder.js:115:27), <anonymous>:87:37)
    at readBytes (eval at createConstructor (c:\Users\Yann\Desktop\telegram\node_modules\telegram.link\node_modules\telegram-tl-node\lib\builder\constructor-builder.js:115:27), <anonymous>:88:21)
    at readBytes (eval at createConstructor (c:\Users\Yann\Desktop\telegram\node_modules\telegram.link\node_modules\telegram-tl-node\lib\builder\constructor-builder.js:115:27), <anonymous>:88:21)
    at readBytes (eval at createConstructor (c:\Users\Yann\Desktop\telegram\node_modules\telegram.link\node_modules\telegram-tl-node\lib\builder\constructor-builder.js:115:27), <anonymous>:88:21)
    at readBytes (eval at createConstructor (c:\Users\Yann\Desktop\telegram\node_modules\telegram.link\node_modules\telegram-tl-node\lib\builder\constructor-builder.js:115:27), <anonymous>:88:21)
    at readBytes (eval at createConstructor (c:\Users\Yann\Desktop\telegram\node_modules\telegram.link\node_modules\telegram-tl-node\lib\builder\constructor-builder.js:115:27), <anonymous>:88:21)
    at readBytes (eval at createConstructor (c:\Users\Yann\Desktop\telegram\node_modules\telegram.link\node_modules\telegram-tl-node\lib\builder\constructor-builder.js:115:27), <anonymous>:88:21)
    at readBytes (eval at createConstructor (c:\Users\Yann\Desktop\telegram\node_modules\telegram.link\node_modules\telegram-tl-node\lib\builder\constructor-builder.js:115:27), <anonymous>:88:21)
    at readBytes (eval at createConstructor (c:\Users\Yann\Desktop\telegram\node_modules\telegram.link\node_modules\telegram-tl-node\lib\builder\constructor-builder.js:115:27), <anonymous>:88:21)
    at readBytes (eval at createConstructor (c:\Users\Yann\Desktop\telegram\node_modules\telegram.link\node_modules\telegram-tl-node\lib\builder\constructor-builder.js:115:27), <anonymous>:88:21)

It happens with a limit of 5 messages, tell me if you need more logs

enricostara commented 9 years ago

Hi @badoualy,

I released a new version and now you should be able to properly call the messages.getHistory method with the right arguments, see here

Let me know!

badoualy commented 9 years ago

Ok it's working, but not when I get too many messages, or if I get like a few messages of 4096 (max) each, in those cases I have the error of stack size exceeded

enricostara commented 9 years ago

I found the problem, it was when in your message-history occurs a message with a photo. There was a very old bug in telegram-tl-node module, I fixed it..

Let me know!

badoualy commented 9 years ago

Fixed indeed ! Awesome ! Thanks !