protocol-grpc 0.16.0 → 0.17.0

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: f2d0b8c7ab88b83ceb64b1cbcd59828bf95416c35b9eafb94892b6c847b4820c
4
- data.tar.gz: e9283b64b23825657eb739beddb581bd6e3596264e627e7d0cbe5441cd1220de
3
+ metadata.gz: bf0f2ec7ae263ceb0b3191c0f3da1b9a6222dd3e0b5e584cc2ec19fa7ebb8857
4
+ data.tar.gz: 303bf31a141edf34f610e1f2a4432571af30c15b65cfc784d1de00915cecb765
5
5
  SHA512:
6
- metadata.gz: 67dfce9bbf3d3cf7255579c5fd0467b879a6c23c07bbecb3556ee7154922aeeb834fcca6ba9f7a5e8fa025c40d8db141a53db78cf8293fa5c932c55ee0dd6d09
7
- data.tar.gz: 7c90ef5c07d6a142e9bcdd1f5938b9253f6e73902b5ab284fb1c1b3f9d4167540ed09a81c900eff8996146ffe400a43cb03bcf9fda76b92c3c89cf383cffa3a4
6
+ metadata.gz: e8d6063d80afcb48d81acc7ac8b3a568c73b8726bb5e369101a5aae49cd31ab66af5cb483304c578db95cf6d03757b8e92460f389a03216ab5870e2b332e519c
7
+ data.tar.gz: 4b7031d73d14092692c1fa05f0a6960446e50b37dd4088fa0132e89cf4be143f32c74f2ff1554ecf9248de67ed4688520bc98898566cb83dac7f9daef64c74d6
checksums.yaml.gz.sig CHANGED
Binary file
@@ -48,6 +48,7 @@ module Protocol
48
48
 
49
49
  # Read the next gRPC message.
50
50
  # Overrides Wrapper#read to transform raw HTTP body chunks into decoded gRPC messages.
51
+ # Errors raised by the underlying body propagate unchanged.
51
52
  # @returns [Object | String | Nil] Decoded message, raw binary, or `Nil` if stream ended
52
53
  def read
53
54
  # Read 5-byte prefix: 1 byte compression flag + 4 bytes length
@@ -85,14 +86,8 @@ module Protocol
85
86
  def read_exactly(n)
86
87
  # Fill buffer until we have enough data:
87
88
  while @buffer.bytesize < n
88
- if @body.nil? || @body.empty?
89
- return nil if @buffer.empty?
90
-
91
- raise Error.new(Status::INTERNAL, "Truncated gRPC frame: expected #{n} bytes, received #{@buffer.bytesize}")
92
- end
93
-
94
- # Read chunk from underlying body:
95
- chunk = @body.read
89
+ # An empty body can still have a pending error, so read to determine EOF:
90
+ chunk = @body&.read
96
91
 
97
92
  if chunk.nil?
98
93
  return nil if @buffer.empty?
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2025, by Samuel Williams.
4
+ # Copyright, 2025-2026, by Samuel Williams.
5
5
 
6
6
  require "async/deadline"
7
7
  require_relative "metadata"
@@ -2,6 +2,7 @@
2
2
 
3
3
  # Released under the MIT License.
4
4
  # Copyright, 2025, by Samuel Williams.
5
+ # Copyright, 2026, by Alex Watt.
5
6
 
6
7
  module Protocol
7
8
  module GRPC
@@ -1,7 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2025, by Samuel Williams.
4
+ # Copyright, 2025-2026, by Samuel Williams.
5
+ # Copyright, 2026, by Alex Watt.
5
6
 
6
7
  module Protocol
7
8
  module GRPC
@@ -7,7 +7,7 @@
7
7
  module Protocol
8
8
  # @namespace
9
9
  module GRPC
10
- VERSION = "0.16.0"
10
+ VERSION = "0.17.0"
11
11
  end
12
12
  end
13
13
 
data/lib/protocol/grpc.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2025, by Samuel Williams.
4
+ # Copyright, 2025-2026, by Samuel Williams.
5
5
 
6
6
  require_relative "grpc/version"
7
7
 
data/license.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # MIT License
2
2
 
3
3
  Copyright, 2025-2026, by Samuel Williams.
4
+ Copyright, 2026, by Alex Watt.
4
5
 
5
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
7
  of this software and associated documentation files (the "Software"), to deal
data/readme.md CHANGED
@@ -28,6 +28,10 @@ Please see the [project documentation](https://socketry.github.io/protocol-grpc/
28
28
 
29
29
  Please see the [project releases](https://socketry.github.io/protocol-grpc/releases/index) for all releases.
30
30
 
31
+ ### v0.17.0
32
+
33
+ - Preserve underlying body read errors, including failures before a message, during a partial frame, or while finishing the stream. These failures are no longer hidden as EOF or replaced with a truncated-frame error.
34
+
31
35
  ### v0.16.0
32
36
 
33
37
  - Preserve timeout precision within the eight-digit wire limit, rounding up when necessary.
@@ -72,12 +76,6 @@ Please see the [project releases](https://socketry.github.io/protocol-grpc/relea
72
76
 
73
77
  - Add `RPC#name`.
74
78
 
75
- ### v0.3.0
76
-
77
- - **Breaking**: `Protocol::GRPC::Call` now takes a `response` object parameter instead of separate `response_headers`.
78
- - **Breaking**: Removed `Call#response_headers` method. Use `call.response.headers` directly.
79
- - Added `RPC#streaming?` method to check if an RPC is streaming.
80
-
81
79
  ## See Also
82
80
 
83
81
  - [async-grpc](https://github.com/socketry/async-grpc) — Asynchronous gRPC client and server implementation using this interface.
@@ -98,16 +96,16 @@ We welcome contributions to this project.
98
96
 
99
97
  To run the test suite:
100
98
 
101
- ``` shell
102
- bundle exec sus
99
+ ``` bash
100
+ $ bundle exec sus
103
101
  ```
104
102
 
105
103
  ### Making Releases
106
104
 
107
105
  To make a new release:
108
106
 
109
- ``` shell
110
- bundle exec bake gem:release:patch # or minor or major
107
+ ``` bash
108
+ $ bundle exec bake gem:release:patch # or minor or major
111
109
  ```
112
110
 
113
111
  ### Developer Certificate of Origin
data/releases.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Releases
2
2
 
3
+ ## v0.17.0
4
+
5
+ - Preserve underlying body read errors, including failures before a message, during a partial frame, or while finishing the stream. These failures are no longer hidden as EOF or replaced with a truncated-frame error.
6
+
3
7
  ## v0.16.0
4
8
 
5
9
  - Preserve timeout precision within the eight-digit wire limit, rounding up when necessary.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,10 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-grpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
+ - Alex Watt
8
9
  bindir: bin
9
10
  cert_chain:
10
11
  - |
metadata.gz.sig CHANGED
Binary file