I'm currently working on incorporating Server-Sent Events (SSE) into my testing application. The server side configuration has been completed, and I am utilizing the endpoint (api/v1/sse/document). The aim here is that whenever a scan is performed, I expect to see the results reflected in both my testing client and main application simultaneously. However, the issue I'm facing is that the updates only show up in my testing client after manually refreshing the page. Despite writing some code, I haven't been successful in achieving automatic event updates in my testing client.
Below is the code snippet that I have written:
[document-list.component.ts]
// Include component functions and methods here...
In addition, this is the service responsible for handling document-related operations:
[a.service.ts]
// Add service functionality and methods here...
Even though there are no error messages displayed in the console, and a 200 response is received from the endpoint, the events are not automatically propagated to my testing client. Instead, I have to refresh the page each time to observe the changes. Any insights or suggestions on resolving this issue would be greatly appreciated.