grpc loader.defauts does not work to control the response value
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- node.js, typescript
調査の方向性
appx ディレクトリにあるリンク先の最小再現から始め、pnpm i に続けて pnpm start:dev を実行します。列挙されている gRPC クライアント間で loader.defaults の挙動を比較し、次に NestJS GRPC トランスポートが loader オプションを @grpc/proto-loader に渡す方法を追跡します。各クライアントのレスポンスをそのオプションで制御すべきかどうかを明らかにし、リポジトリに該当するテストが含まれている場合は対象を絞った回帰テストを追加できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Current behavior
we want to get such response from grpc api
{
"code": 0,
"statusCode": 1,
"data": {
"nullValue": null,
"zeroValue": 0,
"message": "great"
}
}
so we overwrite the options.loader.defaults to get the zero value code item as follows:
app.connectMicroservice(
{
transport: Transport.GRPC,
options: {
url: '0.0.0.0:6000', // gRPC 服务的地址和端口
package: 'hello', // proto 文件中的 package 名称
protoPath: join(__dirname, '../proto/hello.proto'), // proto 文件路径
loader: {
defaults: true, // expected to get the zero value code in response
arrays: true,
objects: true,
json: true,
},
},
},
but we when I tested the result, I get confused because the result are not the same rule.
- with Postman we always get the zero value code in response whether loader.defaults is true
- with GRPC Client code we always get the zero value code in response whether loader.defaults is true
- with grpcurl we always cannot get the zero value code in response whether loader.defaults is true
- with Jetbrains HTTPClient we always cannot get the zero value code in response whether loader.defaults is true
Minimum reproduction code
https://github.com/rawbin-/nest-grpc-test/tree/main/appx
Steps to reproduce
pnpm i
pnpm start:dev
test with any grpc client tool
Expected behavior
loader.defaults can control the result
Packages versions
"@grpc/grpc-js": "^1.13.3",
"@grpc/proto-loader": "^0.7.15",
"@nestjs/common": "^10.0.0",
"@nestjs/core": "^10.0.0",
"@nestjs/microservices": "^11.1.0",
"@nestjs/platform-express": "^10.0.0",
"grpc": "^1.24.11",
"reflect-metadata": "^0.2.0",
"rxjs": "^7.8.1"
Node.js version
v18.20.7
In which operating systems have you tested?
- macOS
- Windows
- Linux
- 主要言語
- TypeScript
- スター
- 4.8k
- フォーク
- 716
- 平均マージ
- 1日 18時間
- マージ済み PR(30日)
- 17
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
grpc/grpc-node のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信
-
package: @grpc/grpc-js
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
grpc/grpc-node#2993 · コメント 3 件 · リアクション 4 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
grpc/grpc-node#3091 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
feature request
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
grpc/grpc-node#3077 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
grpc/grpc-node#3068 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
openedx/frontend-app-authoring#3274 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
area/documentation status/need-triage
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
google-gemini/gemini-cli#29548 ·
メンテナーはふだん 1 日以内に返信
-
sdk-typescript vector-store
難易度 2/5 半日 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信