Missing User or UserId field in QueryPollsRequest model

未关闭
#9 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
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 分钟
30 天内合并 PR
19

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

GetStream/getstream-net 的其他 Issue

查看 GetStream/getstream-net 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。