mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-28 08:49:42 +02:00
fix: reject misrouted smallwebrtc runs on the telephony websocket (#468)
* fix: reject misrouted smallwebrtc runs on the telephony websocket A smallwebrtc (browser/WebRTC) workflow run is established through the WebRTC signaling endpoint, not the PSTN telephony websocket. When such a run reached _handle_telephony_websocket it read no "provider" from initial_context and closed with an opaque "Provider type not found". Detect smallwebrtc runs and close with a clear reason pointing to the signaling endpoint, without setting the run to running or invoking a telephony provider. Also store the provider on smallwebrtc runs at creation so they are self-describing, and make the generic no-provider close reason include the run id and mode. Closes #433 * fix: merge workflow run initial context defaults --------- Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: Abhishek Kumar <abhishek@a6k.me>
This commit is contained in:
parent
faa73427c6
commit
3309face2c
5 changed files with 108 additions and 5 deletions
|
|
@ -606,3 +606,34 @@ class TestRunDefinitionBinding:
|
|||
)
|
||||
|
||||
assert run.definition_id == draft.id
|
||||
|
||||
async def test_run_initial_context_merges_with_template_context(
|
||||
self, db_session, workflow_with_v1
|
||||
):
|
||||
"""Explicit run context should augment template context, not replace it."""
|
||||
workflow, user = workflow_with_v1
|
||||
await db_session.save_workflow_draft(
|
||||
workflow_id=workflow.id,
|
||||
template_context_variables={
|
||||
"company_name": "Acme",
|
||||
"default_only": "kept",
|
||||
},
|
||||
)
|
||||
await db_session.publish_workflow_draft(workflow.id)
|
||||
|
||||
run = await db_session.create_workflow_run(
|
||||
name="Embed Run",
|
||||
workflow_id=workflow.id,
|
||||
mode="smallwebrtc",
|
||||
user_id=user.id,
|
||||
initial_context={
|
||||
"company_name": "Override Co",
|
||||
"provider": "smallwebrtc",
|
||||
},
|
||||
)
|
||||
|
||||
assert run.initial_context == {
|
||||
"company_name": "Override Co",
|
||||
"default_only": "kept",
|
||||
"provider": "smallwebrtc",
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue