Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EventSource - fetching batch results by sse loses events #3247

Open
mgordel opened this issue Jun 12, 2024 · 1 comment
Open

EventSource - fetching batch results by sse loses events #3247

mgordel opened this issue Jun 12, 2024 · 1 comment
Labels
sdk-request issue requested by SDK team

Comments

@mgordel
Copy link

mgordel commented Jun 12, 2024

When I use EventSource to retrieve Batch results, it happens that for quickly executed scripts, e.g. echo Hello World, I am not able to subscribe to events after sending the script and I lose the results for that script.

e.g.

// POST /activity/{activityId}/exec sending `echo Hello World`
const eventSource = new EventSource(`${baseUrl}/activity-api/v1/activity/${activityId}/exec/${batchId}`)
eventSource.addEventListener("runtime", (event) => console.log(event));

I don't get any events in this example. When I change the script to sleep 1 && echo "Hello World" the event appears.

There is a time gap between sending the post and the event subscription in which an event with the result of the batch script is emitted and I am not able to capture this event.

Maybe it would be possible to add a parameter so that I could specify, for example, from what time I would like to receive events... afterTimestamp ?

@mgordel mgordel added the sdk-request issue requested by SDK team label Jun 12, 2024
@grisha87
Copy link
Contributor

grisha87 commented Aug 9, 2024

@prekucki , Can we prioritise this? We're having too many cases where we need top put sleep 2 in front of every command to not loose the first events :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sdk-request issue requested by SDK team
Projects
None yet
Development

No branches or pull requests

2 participants