telegram-support-bot 0.1.15 → 0.1.16

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 628391b6587ec2b35dc5ce2984276eb42f4f5d5e992205ef06682f26ad41b8cf
4
- data.tar.gz: 9edfd943aee7356088dede4f647609ee9f9c6cc34d9ba82a3bbdb61feef241fa
3
+ metadata.gz: fa277fa81bc6ee057b77777a2d95810f824d31ef6b7d059c27ba421bd83848a7
4
+ data.tar.gz: 4d50ba56cd4b32172171a2de94277be16efa3be397176b2e0206b7107c60cf9e
5
5
  SHA512:
6
- metadata.gz: 98fb134361de2705a30e239708f317565aaa50728a1a6516516ea6e4728bb216b1c6e2a7195996a8337fe46d85b8ddb77b3185122ada7f9b7088666742d64d0e
7
- data.tar.gz: 205c10c6546720fabe6d1167846409f9f08cfd9fa264ee8e2218f973c032556d5742766c069cb3a1fedced5e2db6489a220601bf315a5f91d4841349daa27f45
6
+ metadata.gz: 6002edf0a9948bd06c6ca3447e0fb632cef101b117bbb2d840ab6fbf56f5976cf42548101da13d628e5d1c6e20ca90e2692c778c4c855d8b577de4e5df2cc05f
7
+ data.tar.gz: fe7f510f82589e03f9b523d2c22abd0ae06c08f04cc1bfae8bbf25d16ce45a1d0d3edeae2cfabb86eee3ad6f33a91b0d214f774ada6dc04fccbebbe566c927c0
data/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.1.16] - 2026-02-26
8
+
9
+ ### Fixed
10
+ - Simplified dedup marker evaluation to strict boolean/hash semantics and removed permissive fallback coercion.
11
+ - Dedup marker read/write failures now fail open (warn and continue) instead of breaking webhook update processing.
12
+
7
13
  ## [0.1.15] - 2026-02-26
8
14
 
9
15
  ### Added
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TelegramSupportBot
4
- VERSION = "0.1.15"
4
+ VERSION = "0.1.16"
5
5
  end
@@ -532,27 +532,32 @@ module TelegramSupportBot
532
532
  end
533
533
 
534
534
  def start_forwarded_to_support?(chat_id)
535
- marker_present?(start_forwarded_users[chat_id])
535
+ marker_enabled?(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
- marker_present?(processed_updates[update_id])
541
+ marker_enabled?(processed_updates[update_id])
542
+ rescue StandardError => error
543
+ warn_processed_update_marker_read_failure(update_id: update_id, error: error)
544
+ false
542
545
  end
543
546
 
544
547
  def mark_update_as_processed(update_id)
545
548
  return if update_id.nil?
546
549
 
547
550
  processed_updates[update_id] = processed_update_marker_value
551
+ rescue StandardError => error
552
+ warn_processed_update_marker_write_failure(update_id: update_id, error: error)
548
553
  end
549
554
 
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)
555
+ def marker_enabled?(value)
556
+ return true if value == true
557
+ return false if value.nil? || value == false
558
+ return marker_enabled?(value[:present] || value['present']) if value.is_a?(Hash)
554
559
 
555
- true
560
+ false
556
561
  end
557
562
 
558
563
  def start_forwarded_marker_value
@@ -567,6 +572,14 @@ module TelegramSupportBot
567
572
  warn "Failed to forward initial /start for chat_id=#{chat_id} message_id=#{message_id}: #{error.class}: #{error.message}"
568
573
  end
569
574
 
575
+ def warn_processed_update_marker_read_failure(update_id:, error:)
576
+ warn "Failed to read processed update marker for update_id=#{update_id}: #{error.class}: #{error.message}"
577
+ end
578
+
579
+ def warn_processed_update_marker_write_failure(update_id:, error:)
580
+ warn "Failed to persist processed update marker for update_id=#{update_id}: #{error.class}: #{error.message}"
581
+ end
582
+
570
583
  def contact_known_for_user?(chat_id)
571
584
  !user_profile(chat_id).nil?
572
585
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telegram-support-bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Buslaev