Missing User or UserId field in QueryPollsRequest model
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
首先定位 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,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
GetStream/getstream-net 的其他 Issue
-
难度 4/5 1-2 天 新手友好度 35/100
GetStream/getstream-net#100 · 9 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 1 天内回复
查看 GetStream/getstream-net 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
microsoft/calculator#2532 ·
-
area: scaffold status: needs-tests
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
provider:flagd type:fix
难度 2/5 1-3 小时 新手友好度 74/100
open-feature/dotnet-sdk-contrib#789 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 72/100
NimblePros/Metronome#23 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
jsboige/CoursIA#28504 · 3 条评论 ·
维护者通常 1 天内回复