Summary
Toggling history mode inside a process instance view does not switch the data source of the instance details — the view keeps showing whatever was loaded first (live or history) until a full page reload.
Steps to reproduce
- Open a process instance (live view, no
?history=true).
- Click "Enable History Mode".
Observed
The URL changes, but state.api.process.instance.one is never refetched — the details still come from GET /process-instance/{id}. The reverse direction (starting in history mode, toggling off) is equally stale.
Root cause (src/pages/Processes.jsx, InstanceDetails)
The fetch is guarded on an empty signal instead of reacting to its inputs:
if (state.api.process.instance.one === undefined ||
state.api.process.instance.one.value === null) {
if (!history_mode) { /* live fetch */ } else { /* history fetch */ }
}
Once the signal holds data, toggling history_mode never triggers the other endpoint. InstanceVariables directly below already implements the correct pattern.
Suggested fix
Prototyped locally — same effect pattern as InstanceVariables:
useEffect(() => {
if (!selection_id) return;
if (!history_mode) {
void engine_rest.process_instance.one(state, selection_id);
} else {
void engine_rest.history.process_instance.one(state, selection_id);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [selection_id, history_mode]);
Note: the GET helper keeps previous data while LOADING, so the toggle does not flicker.
Related
Even with the refetch fixed, the details description currently renders only instance id and business key, so the richer history payload (endTime, durationInMillis, state) remains invisible — tracked separately.
Summary
Toggling history mode inside a process instance view does not switch the data source of the instance details — the view keeps showing whatever was loaded first (live or history) until a full page reload.
Steps to reproduce
?history=true).Observed
The URL changes, but
state.api.process.instance.oneis never refetched — the details still come fromGET /process-instance/{id}. The reverse direction (starting in history mode, toggling off) is equally stale.Root cause (
src/pages/Processes.jsx,InstanceDetails)The fetch is guarded on an empty signal instead of reacting to its inputs:
Once the signal holds data, toggling
history_modenever triggers the other endpoint.InstanceVariablesdirectly below already implements the correct pattern.Suggested fix
Prototyped locally — same effect pattern as
InstanceVariables:Note: the
GEThelper keeps previousdatawhileLOADING, so the toggle does not flicker.Related
Even with the refetch fixed, the details description currently renders only instance id and business key, so the richer history payload (
endTime,durationInMillis,state) remains invisible — tracked separately.