telegram-support-bot 0.1.14 → 0.1.15
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -1
- data/lib/telegram_support_bot/version.rb +1 -1
- data/lib/telegram_support_bot.rb +20 -4
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 628391b6587ec2b35dc5ce2984276eb42f4f5d5e992205ef06682f26ad41b8cf
|
|
4
|
+
data.tar.gz: 9edfd943aee7356088dede4f647609ee9f9c6cc34d9ba82a3bbdb61feef241fa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 98fb134361de2705a30e239708f317565aaa50728a1a6516516ea6e4728bb216b1c6e2a7195996a8337fe46d85b8ddb77b3185122ada7f9b7088666742d64d0e
|
|
7
|
+
data.tar.gz: 205c10c6546720fabe6d1167846409f9f08cfd9fa264ee8e2218f973c032556d5742766c069cb3a1fedced5e2db6489a220601bf315a5f91d4841349daa27f45
|
data/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
-
## [0.1.
|
|
7
|
+
## [0.1.15] - 2026-02-26
|
|
8
8
|
|
|
9
9
|
### Added
|
|
10
10
|
- Optional `forward_start_to_support` configuration to forward the first user `/start`
|
|
@@ -15,6 +15,8 @@ All notable changes to this project will be documented in this file.
|
|
|
15
15
|
### Fixed
|
|
16
16
|
- Initial `/start` forwarding is now fail-safe: errors in forwarding/persisting first-message
|
|
17
17
|
marker no longer crash update processing and block subsequent updates.
|
|
18
|
+
- Redis-backed marker storage for update/start dedup now writes JSON objects (not scalar booleans),
|
|
19
|
+
fixing `JSON::GeneratorError: only generation of JSON objects or arrays allowed` on stricter runtimes.
|
|
18
20
|
|
|
19
21
|
## [0.1.12] - 2026-02-26
|
|
20
22
|
|
data/lib/telegram_support_bot.rb
CHANGED
|
@@ -526,25 +526,41 @@ module TelegramSupportBot
|
|
|
526
526
|
return unless should_forward_start_to_support?(chat_id)
|
|
527
527
|
return unless forward_message_to_support_chat(message, chat_id: chat_id)
|
|
528
528
|
|
|
529
|
-
start_forwarded_users[chat_id] =
|
|
529
|
+
start_forwarded_users[chat_id] = start_forwarded_marker_value
|
|
530
530
|
rescue StandardError => error
|
|
531
531
|
warn_start_forwarding_failure(chat_id: chat_id, message_id: message['message_id'], error: error)
|
|
532
532
|
end
|
|
533
533
|
|
|
534
534
|
def start_forwarded_to_support?(chat_id)
|
|
535
|
-
|
|
535
|
+
marker_present?(start_forwarded_users[chat_id])
|
|
536
536
|
end
|
|
537
537
|
|
|
538
538
|
def duplicate_update?(update_id)
|
|
539
539
|
return false if update_id.nil?
|
|
540
540
|
|
|
541
|
-
|
|
541
|
+
marker_present?(processed_updates[update_id])
|
|
542
542
|
end
|
|
543
543
|
|
|
544
544
|
def mark_update_as_processed(update_id)
|
|
545
545
|
return if update_id.nil?
|
|
546
546
|
|
|
547
|
-
processed_updates[update_id] =
|
|
547
|
+
processed_updates[update_id] = processed_update_marker_value
|
|
548
|
+
end
|
|
549
|
+
|
|
550
|
+
def marker_present?(value)
|
|
551
|
+
return false if value.nil?
|
|
552
|
+
return value if value == true || value == false
|
|
553
|
+
return value.fetch(:present, value['present']) if value.is_a?(Hash)
|
|
554
|
+
|
|
555
|
+
true
|
|
556
|
+
end
|
|
557
|
+
|
|
558
|
+
def start_forwarded_marker_value
|
|
559
|
+
{ present: true }
|
|
560
|
+
end
|
|
561
|
+
|
|
562
|
+
def processed_update_marker_value
|
|
563
|
+
{ present: true }
|
|
548
564
|
end
|
|
549
565
|
|
|
550
566
|
def warn_start_forwarding_failure(chat_id:, message_id:, error:)
|