فهرست منبع

Stop adding msgAck to pending states.

painor 3 سال پیش
والد
کامیت
52b0e9f3b9
5فایلهای تغییر یافته به همراه7 افزوده شده و 6 حذف شده
  1. 1 1
      gramjs/Version.ts
  2. 2 1
      gramjs/extensions/MessagePacker.ts
  3. 2 2
      package-lock.json
  4. 1 1
      package.json
  5. 1 1
      publish_npm.js

+ 1 - 1
gramjs/Version.ts

@@ -1 +1 @@
-export const version = "1.10.7";
+export const version = "1.10.8";

+ 2 - 1
gramjs/extensions/MessagePacker.ts

@@ -42,7 +42,8 @@ export class MessagePacker {
         if (this.setReady) {
         if (this.setReady) {
             this.setReady(true);
             this.setReady(true);
         }
         }
-        if (state) {
+        // we don't want msg acks here
+        if (state && state.request.CONSTRUCTOR_ID != 1658238041) {
             this._pendingStates.push(state);
             this._pendingStates.push(state);
             state.promise
             state.promise
                 // Using finally causes triggering `unhandledrejection` event
                 // Using finally causes triggering `unhandledrejection` event

+ 2 - 2
package-lock.json

@@ -1,12 +1,12 @@
 {
 {
   "name": "telegram",
   "name": "telegram",
-  "version": "1.10.7",
+  "version": "1.10.8",
   "lockfileVersion": 2,
   "lockfileVersion": 2,
   "requires": true,
   "requires": true,
   "packages": {
   "packages": {
     "": {
     "": {
       "name": "telegram",
       "name": "telegram",
-      "version": "1.10.7",
+      "version": "1.10.8",
       "license": "MIT",
       "license": "MIT",
       "dependencies": {
       "dependencies": {
         "@cryptography/aes": "^0.1.1",
         "@cryptography/aes": "^0.1.1",

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "telegram",
   "name": "telegram",
-  "version": "1.10.7",
+  "version": "1.10.8",
   "description": "NodeJS/Browser MTProto API Telegram client library,",
   "description": "NodeJS/Browser MTProto API Telegram client library,",
   "main": "index.js",
   "main": "index.js",
   "types": "index.d.ts",
   "types": "index.d.ts",

+ 1 - 1
publish_npm.js

@@ -13,7 +13,7 @@ tsc.on("close", (code) => {
     fs.copyFileSync("gramjs/tl/static/schema.tl", "dist/tl/static/schema.tl");
     fs.copyFileSync("gramjs/tl/static/schema.tl", "dist/tl/static/schema.tl");
     fs.copyFileSync("gramjs/tl/api.d.ts", "dist/tl/api.d.ts");
     fs.copyFileSync("gramjs/tl/api.d.ts", "dist/tl/api.d.ts");
     fs.copyFileSync("gramjs/define.d.ts", "dist/define.d.ts");
     fs.copyFileSync("gramjs/define.d.ts", "dist/define.d.ts");
-    const npm_publish = exec("npm publish", { cwd: "dist" });
+    const npm_publish = exec("npm publish --next", { cwd: "dist" });
     npm_publish.stdout.on("data", function (data) {
     npm_publish.stdout.on("data", function (data) {
       console.log(data.toString());
       console.log(data.toString());
     });
     });