Skip to content

Client should not panic if an operation doesn't return anything #169

@gregolsky

Description

@gregolsky

The client 'panics' when OperationIDResult is not returned by the server. That should not be the case. There are various commands which do not return anything (Send() returns void) or do return something else (TResult).

panicIf(true, "called on a command %T that doesn't return OperationIDResult", cmd)

Please refer to ServerOperationExecutor code in C#:
https://github.com/ravendb/ravendb/blob/49086f551a2ec7349c0922f6ec96c189f94fb7a6/src/Raven.Client/ServerWide/Operations/ServerOperationExecutor.cs

As you can see there are various method overloads - some returning void:

public void Send(IServerOperation operation)
public TResult Send<TResult>(IServerOperation<TResult> operation)
public Operation Send(IServerOperation<OperationIdResult> operation)

public async Task SendAsync(IServerOperation operation, CancellationToken token = default)
public async Task<TResult> SendAsync<TResult>(IServerOperation<TResult> operation, CancellationToken token = default)
public async Task<Operation> SendAsync(IServerOperation<OperationIdResult> operation, CancellationToken token = default)

The issue might not be in the ServerOperationExecutor alone - it may be the case with other operation executor classes as well.

Please advise.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions