Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client filter is not triggered for ServerStreamingResult method in services. #728

Open
licentia88 opened this issue Dec 28, 2023 · 1 comment

Comments

@licentia88
Copy link

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.

@mayuki
Copy link
Member

mayuki commented Mar 21, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants