Missing User or UserId field in QueryPollsRequest model

オープン
#9 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
csharp
領域
api

調査の方向性

まず QueryPollsRequest モデルと QueryPollsAsync エントリポイントを見つけ、次にそれらがサポートするフィールドとサーバー認証エラーを比較します。user または user_id をリクエスト経由で指定し、クエリにシリアライズできることを確認します。報告された呼び出しを再現し、400 エラーなしで成功することを確認します。

索引モデルが issue の本文から書いたものです。

説明

When trying to query polls, I get an error indicating that I need to provide user or user_id because I'm using server authentication.
I've tried adding the user or user_id in the Filter object, but I didn't have luck.

My code

StreamResponse<PollResponse> poll = await client.CreatePollAsync(new CreatePollRequest()
{
    UserID = "SampleUserId",
    AllowAnswers = true,
    Name = "Give us feedback",
    Options = [new PollOptionInput() { Text = "Very disatisfied" }, new PollOptionInput() { Text = "Dissatisfied" }, new PollOptionInput() { Text = "Average" }, new PollOptionInput() { Text = "Satisfied" }, new PollOptionInput() { Text = "Very satisfied" }],

});

StreamResponse<QueryPollsResponse> existingPoll = await client.QueryPollsAsync(new QueryPollsRequest() // error happens here
{
    Filter = new Dictionary<string, string>()
    {
        { "name", "Give us feedback" },
        { "user", "SampleUserId" }
    },
    Limit = 2
});

Observation

I recieve the following error when using QueryPollsAsync()

GetStream.GetStreamApiException: 'HTTP BadRequest: {"code":4,"message":"QueryPolls failed with error: \"either user or user_id must be provided when using server side auth.\"","StatusCode":400,"duration":"0.00ms","more_info":"https://getstream.io/chat/docs/api_errors_response","details":[]}'

Expectation

I expect to be able to provide the user or user_id through the library

Environment

SDK: getstream-net 2.1.0
.NET: 9.0

cc @itsmeadi

主要言語
C#
スター
2
フォーク
0
平均マージ
6時間 55分
マージ済み PR(30日)
19

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

GetStream/getstream-net のほかの issue

GetStream/getstream-net の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。