Effect CommunityEC
Effect Community6mo ago
23 replies
garrett

Potential Issue with `discard` Option in RPC Proxy with Persisted Messages

I think there may be an issue with the discard option when using an RPC proxy and persisted messages. I dont believe it actually waits for the message to be persisted in the cluster.

I am running this inside a serverless function that is closed as soon as the effect ends

// Send the message to the cluster
          yield* cluster.IssueHandler.RespondToToolCall(
            {
              entityId: issueId,
              payload: {
                message: updateMessage,
                operator,
              },
            },
            { discard: true },
          );
// returns and cleans up runtime right after


If I run this as is, the message never actually makes it to the entity. If i remove the discard or throw in a 5 second sleep then it works properly. I would expect that the discard would not wait for the result of the message, but should still ensure that the message gets persisted
Was this page helpful?