-
Story
-
Resolution: Postponed
-
Major
-
None
-
-
1.0-m11, 1.0-m12
Sometimes SSE events can happen too fast for the client to make sense of them because of other incomplete async work relating to earlier events.
E.g.
When new branches are added to a multi-branch job, events are fired in the following order:
- CRUD create event for the branch job
- Job build run queued
- Job build run started
- etc
Atm, the above sequence of events happens too fast for the UI. The CRUD create event is still being processed (getting the branch info and updating the redux store) when the build run queued/started events arrive.
When the build run queued/started events arrive, branch state update redux actions are triggered, but the redux store still knows nothing about the branch and so ignores it, causing the events to effectively be ignored.
We could rejig the action handlers and store events etc etc, handling things within the redux store, but I think it would be better to try fix this in a generic way if possible because this seems like a scenario that we'll hit again.
My current thinking is that we could tell an SSE listener instance to stop sending specific events for a period of time and play them later when told.
So, taking the above multi-branch job .... when we receive the CRUD create event, we tell the listener to stop sending events for that job for now .... we get the job info, update the redux store and then tell the listener to start sending the events again, at which point it would play all of the events that happened during the window where it was not forwarding the events. This way, the events happen in the client in an order in which it can make more sense of them.
- is related to
-
JENKINS-36238 Server-side store and forward SSE events during a reconnect
- Resolved
-
JENKINS-36055 Update branches list when new branch jobs are created
- Resolved