Missing User or UserId field in QueryPollsRequest model

Aperta
#9 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
csharp
Ambito
api

Direzione di ricerca

Inizia individuando il modello QueryPollsRequest e il punto di ingresso QueryPollsAsync, quindi confronta i campi supportati con l’errore di autenticazione del server. Verifica che user o user_id possano essere forniti tramite la richiesta e serializzati nella query. Riproduci la chiamata segnalata e conferma che abbia esito positivo senza l’errore 400.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
C#
Stelle
2
Fork
0
Merge medio
6h 55m
PR unite (30g)
19

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di GetStream/getstream-net

Tutte le issue di GetStream/getstream-net

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.