Azure / Azure/azure-functions-durable-js

Durable function `raiseEvent` method throws if orchestration function with supplied instanceId does not exist

Open
#618 0 comments 0 reactions 0 assignees View on GitHub
documentation P2
Dominant language
TypeScript
Stars
142
Forks
66
Avg merge
3d 19h
Merged PRs (30d)
4

Description

The documentation for [Send events](https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-external-events?tabs=javascript#send-events) section in the notes states `If there is no orchestration instance with the specified instance ID, the event message is discarded.`
![Image](https://github.com/user-attachments/assets/c6b948a8-09b7-40be-a511-bf022b62fa0d)
This would imply, that when non existing `instanceId` is passed, that the call simply does nothing.
```ts
await client.raiseEvent( // based on docs this should just do nothing if orchestration function with ID my-nonexisting-id does not exist
"my-nonexisting-id",
"SomeEvent",
null
);
```
However in reality when `raiseEvent` method is invoked with non-existing `instanceId` it throws an error:
```
Error: No instance with ID 'my-nonexisting-id' found.
at DurableClient. (C:\Users\nej\source\repos\azf-samples-ts\node_modules\durable-functions\lib\src\durableClient\DurableClient.js:240:43)
at Generator.next ()
at fulfilled (C:\Users\nej\source\repos\azf-samples-ts\node_modules\durable-functions\lib\src\durableClient\DurableClient.js:5:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5
```

**Expected behavior**
Either adjust documentation to state that `raiseEvent` throws in case of non-existing `instanceId` or adjust implementation to not throw in such case.

**Actual behavior**
If `raiseEvent` method is invoked with non-existing `instanceId` it throws an error.

Contributor guide

Open the contributing guide

Research direction

Read the linked Send events documentation and inspect DurableClient.js around line 240, where the reported error is raised. Reproduce the call with a nonexistent instance ID, then determine whether the documented discard behavior or the observed exception is the intended contract. Done means the documentation and implementation agree, with the behavior verified for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.