ksef-rb 0.1.2 → 0.1.3

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: 540290ac5d524843c717ea5d92bba806eda1e4720926d61d5afd5545265d722b
4
- data.tar.gz: dbbed4846d2ede6b17eed4813373f2a1d5acce75f49cc54524d9b6131722b9a3
3
+ metadata.gz: 7f0036e4b7913536223a5b778902fa2bd69f334494b76772df2cf74dc7a2219d
4
+ data.tar.gz: 3bf943a76ccb8504b13475b7c0783b5571e46191a94e2f999253d5ebe54fa9d1
5
5
  SHA512:
6
- metadata.gz: 669073ea7e384dc08459e1ac3aeb0dbc0c7c3ab3256617e13fe3c5bab9efc3cd3c06ffbfb529edac7fbcaaab87400e99de05c23c4ec3f1a99961f6b217f4a4f0
7
- data.tar.gz: ee6e786a4d08f53330c4e46fceb4d5e1ff443a5d0555a89c314fdc782cfb6bc2d307a46c0da069a44cd3a77a81e022149b2319207ca7822699f4828c945b8982
6
+ metadata.gz: 7c99c25e305544ff19f78829e1aa696711b8b19d8439c29f5577b03a4e4e6a0ebe81e225452f094ccc75edb1556234a6654970d5c5136090a4d7fed0986c038f
7
+ data.tar.gz: 642c4bedf0387bc6591b2132f457324b08f413127cba53dca6360d5317b68457fd93622b6fbc6107e0a9f4178ef17e26f16eb066b15aa16a8a45c5eeae9b96f8
data/CHANGELOG.md CHANGED
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.3] - 2026-07-13
11
+
12
+ ### Fixed
13
+ - Retry middleware: `Faraday::RetriableResponse` was missing from
14
+ `Connection::RETRY_OPTIONS[:exceptions]`. Because that key overrides the
15
+ faraday-retry default (which includes it), its absence silently disabled the
16
+ `retry_statuses: [502, 503, 504]` retries **and** leaked the raw synthetic
17
+ `Faraday::RetriableResponse` up the stack instead of mapping it to a typed
18
+ `Ksef::ServerError`. Observed in production as an unretried gateway blip on
19
+ `POST /auth/challenge` surfacing as `Faraday::RetriableResponse` rather than
20
+ being absorbed. The class is now included, so 502/503/504 are retried up to
21
+ `max` and, if still failing, raised as `Ksef::ServerError`. Added regression
22
+ specs covering both retry-then-recover and retry-then-exhaust paths.
23
+
10
24
  ## [0.1.2] - 2026-05-19
11
25
 
12
26
  ### Fixed
@@ -18,10 +18,17 @@ module Ksef
18
18
  backoff_factor: 2,
19
19
  retry_statuses: [502, 503, 504],
20
20
  methods: %i[get head post delete put patch],
21
+ # `Faraday::RetriableResponse` MUST stay in this list: faraday-retry
22
+ # raises it internally to trigger a `retry_statuses` retry. Because we
23
+ # override `exceptions` (rather than inheriting the middleware default,
24
+ # which includes it), omitting it silently disables 502/503/504 retries
25
+ # *and* leaks the raw synthetic exception past `check!` instead of
26
+ # mapping it to a typed `Ksef::ServerError`.
21
27
  exceptions: [
22
28
  Errno::ETIMEDOUT,
23
29
  Faraday::TimeoutError,
24
- Faraday::ConnectionFailed
30
+ Faraday::ConnectionFailed,
31
+ Faraday::RetriableResponse
25
32
  ]
26
33
  }.freeze
27
34
 
@@ -134,7 +141,7 @@ module Ksef
134
141
  end
135
142
 
136
143
  def parse_retry_after(value)
137
- return nil if value.nil?
144
+ return if value.nil?
138
145
 
139
146
  Integer(value)
140
147
  rescue ArgumentError, TypeError
@@ -57,7 +57,7 @@ module Ksef
57
57
  private
58
58
 
59
59
  def parse_date(value)
60
- return nil if value.nil? || value.empty?
60
+ return if value.nil? || value.empty?
61
61
 
62
62
  Date.iso8601(value)
63
63
  rescue ArgumentError
@@ -65,7 +65,7 @@ module Ksef
65
65
  end
66
66
 
67
67
  def parse_time(value)
68
- return nil if value.nil? || value.empty?
68
+ return if value.nil? || value.empty?
69
69
 
70
70
  Time.iso8601(value)
71
71
  rescue ArgumentError
data/lib/ksef/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ksef
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ksef-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michał Siwek