restreamer
restreamer copied to clipboard
Process update via API causes process metadata to become unavailable
Hey,
I have create a process via the Web UI. I am now trying to dynamically update its network source via the API. For that, I am using a minimal config which only includes the things I need to be updated, i.e. the source address. All other properties should remain unchanged.
However, after the config update is sent via the /api/v3/process/{processId} endpoint, its metadata seems to be removed. This becomes visible in the Web UI: When trying to edit the process, no data is available (no network sources, no metadata etc.). The stream name then displays as "Main Channel" instead of the actual name.
The DevTools show that a request to /api/v3/process/restreamer-ui%3Aingest%3A9f61f582-f7b3-46c0-9d1f-e4da4397fb6d/metadata/restreamer-ui returns 404 (this request should return the metadata).
The actual network source update works and the stream automatically reloads the source, just the metadata seems to be missing after the update.
I am using datarhei-core v16.14.0 (linux/arm64) / 2.8.0 / 2024-02-02 in a container.
To Reproduce Steps to reproduce the behavior:
- Create a new process via the Web UI
- Update the process via the
/api/v3/process/{processId}endpoint using a minimal config. The API call can easily be reproduced using curl:curl -X PUT "https://restreamer/api/v3/process/restreamer-ui:ingest:9f61f582-f7b3-46c0-9d1f-e4da4397fb6d" -H "Content-Type: application/json" -H "Authorization: Bearer $JWT" -d '{"id":"restreamer-ui:ingest:9f61f582-f7b3-46c0-9d1f-e4da4397fb6d","input":[{"address":"https://new-network-source"}]}'. Omitting the ID in the config update results in the same situation. Using a non-minimal config with just the network source changed also causes the same issue.
Expected behavior The process metadata should remain available after the update and the Web UI should show the current stream source and metadata (name, author, license etc.).
Related: #668
This bug has been fixed in the dev branch. You can pull the datarhei/restreamer:dev docker image to test it.