@lacrous/omnicloud 0.2.20 → 0.2.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +12 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -6
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/server/index.js +13 -7
- package/server/web/assets/{index-BjgDY1Om.js → index-Dn6lUGQf.js} +70 -70
- package/server/web/index.html +1 -1
package/dist/index.js
CHANGED
|
@@ -2626,11 +2626,15 @@ function mapTelegramError(error, fallbackMessage) {
|
|
|
2626
2626
|
if (error instanceof DomainError) return error;
|
|
2627
2627
|
if (isTelegramRpcError(error)) {
|
|
2628
2628
|
const msg = error.errorMessage ?? "";
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2629
|
+
const seconds = error.seconds;
|
|
2630
|
+
const floodSeconds = typeof seconds === "number" ? seconds : msg.startsWith("FLOOD_WAIT_") ? Number(msg.slice("FLOOD_WAIT_".length)) : null;
|
|
2631
|
+
if (msg.startsWith("FLOOD") && floodSeconds !== null && floodSeconds > 0) {
|
|
2632
|
+
return new RateLimitedError(
|
|
2633
|
+
`Telegram rate limit reached \u2014 retry in ${floodSeconds} seconds`,
|
|
2634
|
+
{
|
|
2635
|
+
retryAfterSeconds: floodSeconds
|
|
2636
|
+
}
|
|
2637
|
+
);
|
|
2634
2638
|
}
|
|
2635
2639
|
switch (msg) {
|
|
2636
2640
|
case "PHONE_NUMBER_INVALID":
|
|
@@ -3064,7 +3068,9 @@ var TelegramStorageProvider = class {
|
|
|
3064
3068
|
try {
|
|
3065
3069
|
await this.client.deleteMessages(this.peer, [Number(ref.messageId)], { revoke: true });
|
|
3066
3070
|
} catch (error) {
|
|
3067
|
-
|
|
3071
|
+
const mapped = mapTelegramError(error, "Telegram delete failed");
|
|
3072
|
+
if (mapped instanceof TelegramFileNotFoundError) return;
|
|
3073
|
+
throw mapped;
|
|
3068
3074
|
}
|
|
3069
3075
|
}
|
|
3070
3076
|
async exists(ref) {
|