MagicOnion icon indicating copy to clipboard operation
MagicOnion copied to clipboard

Client filter is not triggered for ServerStreamingResult method in services.

Open licentia88 opened this issue 2 years ago • 1 comments

Hello, thank you for the great library. love using it!

I have a created a client filter to send additional data to the server, like tokens etc and it works just fine for regular service methods that are of type UnaryResult<> however for ServerStreamingResult services the filter is not triggered

    /// <summary>
    /// Initiates a server streaming operation to asynchronously retrieve a stream of model data in batches.
    /// </summary>
    /// <param name="batchSize">The number of items to retrieve in each batch.</param>
    /// <returns>A task representing the server streaming result containing a stream of model data.</returns>
    public virtual Task<ServerStreamingResult<List<TModel>>> StreamReadAllAsync(int batchSize)
    {
        return Client.StreamReadAllAsync(batchSize);
    }

when a request is made to the server with the above method, filter is not triggered. I know that magiconion does not support client filter for hubs and I know hubs use streamingResult for base. is this a bug or it just how magiconion is configured to behave?

I can pass this data to the server WithHeaders option but it's more convenient to use Filters for this purpose.

again thank you for providing this great library.

licentia88 avatar Dec 28 '23 08:12 licentia88

ClientFilter is a mechanism for MagicOnion's Unary, and does not support other streaming and so on. This is because StreamingResult is almost equivalent to exposing the gRPC API.

mayuki avatar Mar 21 '24 05:03 mayuki

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Sep 18 '24 00:09 github-actions[bot]