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
Unhandled rejection #104
Comments
Show me your code so I can repeat the error. |
By the security reason i can't provide full code, but now i work on write code what can repeat this error. I hope i can provide this code as fast as possible. P.S. Some lines of code may be numbered incorrectly. in some places the function console.log is called |
Just show what parameters you use to call the |
|
I checked it again, and may describe problem in details.
|
Predicate provided before is correct, because error repeats with another one.
Last five predicates before error throwing: Seems like updates object Possible solutions:
|
After one more debugging i can provide more problem details:
I think, problem in this lines:
|
Excellent research, @softforseeker Thank you very much! This issue is fixed in version 5.0.0 - https://t.me/mtproto_core/23 |
Hello there. Since yesterday I have a similar problem everytime when I use a call with any value. For example code from example: class API {
constructor() {
this.mtproto = new MTProto({
api_id: config.api_id,
api_hash: config.api_hash,
storageOptions: {
path: path.resolve(__dirname, `.data/${config.id}.json`),
},
});
}
async call(method, params, options = {}) {
try {
const result = await this.mtproto.call(method, params, options);
return result;
} catch (error) {
console.log(config.id, `${method} error:`, error);
const { error_code, error_message } = error;
if (error_code === 420) {
let seconds = Number(error_message.split('FLOOD_WAIT_')[1]);
if (!seconds) seconds = Number(error_message.split('SLOWMODE_WAIT_')[1]);
let ms = seconds * 1000;
await sleep(ms);
return this.call(method, params, options);
}
if (error_code === 303) {
const [type, dcIdAsString] = error_message.split('_MIGRATE_');
const dcId = Number(dcIdAsString);
if (type === 'PHONE') {
await this.mtproto.setDefaultDc(dcId);
} else {
Object.assign(options, { dcId });
}
return this.call(method, params, options);
}
return Promise.reject(error);
}
}
}
const api = new API();
async function getUser() {
try {
const user = await api.call('users.getFullUser', {
id: {
_: 'inputUserSelf',
},
});
return user;
} catch (error) {
return null;
}
}
let user;
(async () => {
user = await getUser();
})(); Console logs:
|
I faced the same problem, did you manage to solve it? |
I created a new project and ran it on a clean server. Now it's fine, but I don't know how long it will be fine. This does not look like a good way, but it is suitable as a temporary solution. |
I've got exactly the same issue. Any way to solve this issue? Clean project/server does not work for me. |
hi! i have the same issue. Any way to solve it? i don't know how to solve it but it happens many times in my case... |
Version: 4.0.1
When i call messages.getBotCallbackAnswer method i got the following error instead of response:
RangeError: Offset is outside the bounds of the DataView at DataView.getUint32 (<anonymous>) at Deserializer.uint32 (C:\Users\User\project\node_modules\@mtproto\core\src\tl\deserializer\index.cjs:22:33) at Deserializer.long (C:\Users\User\project\node_modules\@mtproto\core\src\tl\deserializer\index.cjs:36:23) at long (C:\Users\User\project\node_modules\@mtproto\core\src\tl\parser\index.cjs:5:33) at result._ (C:\Users\User\project\node_modules\@mtproto\core\src\tl\parser\index.cjs:208:17) at mt_message (C:\Users\User\project\node_modules\@mtproto\core\src\tl\parser\index.cjs:11:51) at vector (C:\Users\User\project\node_modules\@mtproto\core\src\tl\parser\index.cjs:21:17) at result._ (C:\Users\User\project\node_modules\@mtproto\core\src\tl\parser\index.cjs:203:19) at predicate (C:\Users\User\project\node_modules\@mtproto\core\src\tl\parser\index.cjs:29:12) at module.exports (C:\Users\User\project\node_modules\@mtproto\core\src\tl\parser\index.cjs:36:10)
It may be related with telegram updates received in this time.
The text was updated successfully, but these errors were encountered: