Missing User or UserId field in QueryPollsRequest model
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
Research direction
Start by locating the QueryPollsRequest model and the QueryPollsAsync entry point, then compare their supported fields with the server-authentication error. Verify that user or user_id can be supplied through the request and serialized into the query. Reproduce the reported call and confirm it succeeds without the 400 error.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- C#
- Stars
- 2
- Forks
- 0
- Avg merge
- 6h 55m
- Merged PRs (30d)
- 19
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from GetStream/getstream-net
-
Difficulty 4/5 1-2 days Newbie friendliness 35/100
GetStream/getstream-net#100 · 9 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
All issues in GetStream/getstream-net
Similar issues
-
Unit converter reads out of bounds when the saved UnitConverterPreferences setting is malformedOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
microsoft/calculator#2532 ·
-
area: scaffold status: needs-tests
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
provider:flagd type:fix
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
open-feature/dotnet-sdk-contrib#789 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 72/100
NimblePros/Metronome#23 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
jsboige/CoursIA#28504 · 3 comments ·
Maintainers usually reply within 1 day