ui.base_algorithm: graph errors are reported as "do not change the parameters" and leave a stale graph #8

Open
opened 2026-10-06 13:45:42 +00:00 by ffrauenberger · 1 comment
Owner

Severity: medium (the real error is hidden, and the graph no longer matches the parameters)

Where

  • app/ui/base_algorithm_ui/base_algorithm_controller.py:239-260
  • app/ui/genetic_miner_ui/genetic_miner_controller.py:182-189

Problem

Every GraphException raised during mining is shown with the same warning:

except GraphException as ex:
    ...
    st.warning("Do not change the parameters while mining. This will cause an error. ...")

GraphException is the base class of DuplicateNodeException, DuplicateEdgeException, NodeDoesNotExistException and others. These come from deterministic model or converter bugs (e.g. #6, #7), not from slider changes during mining. A slider change during mining can cause errors too (concurrent reruns, see #54), but for these exceptions the stated cause is usually not the real one.

In addition, each miner's generate_graph stores the new thresholds on the model before building the graph. If building fails, the model reports the new parameters but still holds the old graph. On the next rerun have_parameters_changed() returns False, so the app does not retry and keeps showing a graph that does not match the sliders.

Steps to reproduce

  1. Open the application
  2. Import a log that contains an activity named Start (triggers #7)
  3. Mine with any algorithm, or change a slider on an existing graph

Expected behavior

The actual error is shown (and logged with its type). After a failure, the displayed graph is either cleared or the app retries on the next rerun.

Actual behavior

The misleading warning "Do not change the parameters while mining" is shown. The old graph stays on screen and silently disagrees with the selected parameters until the user moves a slider again.

Fix

  • Show the actual exception message and log it with its type.
  • Only assign parameters to the model after the graph was built successfully, or reset self.graph = None / set a "dirty" flag on failure so the next rerun retries.

from issues/BUG-008-graph-exception-handling-hides-errors-and-leaves-stale-graph.md (code analysis of commit 6bcc646, 2026-10-03)

**Severity:** medium (the real error is hidden, and the graph no longer matches the parameters) ## Where - `app/ui/base_algorithm_ui/base_algorithm_controller.py:239-260` - `app/ui/genetic_miner_ui/genetic_miner_controller.py:182-189` ## Problem Every `GraphException` raised during mining is shown with the same warning: ```python except GraphException as ex: ... st.warning("Do not change the parameters while mining. This will cause an error. ...") ``` `GraphException` is the base class of `DuplicateNodeException`, `DuplicateEdgeException`, `NodeDoesNotExistException` and others. These come from deterministic model or converter bugs (e.g. #6, #7), not from slider changes during mining. A slider change during mining can cause errors too (concurrent reruns, see #54), but for these exceptions the stated cause is usually not the real one. In addition, each miner's `generate_graph` stores the new thresholds on the model **before** building the graph. If building fails, the model reports the new parameters but still holds the old graph. On the next rerun `have_parameters_changed()` returns `False`, so the app does not retry and keeps showing a graph that does not match the sliders. ### Steps to reproduce 1. Open the application 2. Import a log that contains an activity named `Start` (triggers #7) 3. Mine with any algorithm, or change a slider on an existing graph ### Expected behavior The actual error is shown (and logged with its type). After a failure, the displayed graph is either cleared or the app retries on the next rerun. ### Actual behavior The misleading warning *"Do not change the parameters while mining"* is shown. The old graph stays on screen and silently disagrees with the selected parameters until the user moves a slider again. ## Fix - Show the actual exception message and log it with its type. - Only assign parameters to the model after the graph was built successfully, or reset `self.graph = None` / set a "dirty" flag on failure so the next rerun retries. --- from `issues/BUG-008-graph-exception-handling-hides-errors-and-leaves-stale-graph.md` (code analysis of commit 6bcc646, 2026-10-03)
Author
Owner

Reviewed by Codex (GPT-6) against origin/main 6bcc646eb464.

Review: partially correct.

The warning and inconsistent parameter/graph state are real. Please qualify “still holds the old graph”: the fuzzy converter assigns miner.graph = graph before adding nodes and edges (dfg_converter.py:120–135), so failures there can leave a partially built replacement graph rather than the old one. Also, both cited GraphException handlers already call logger.exception(ex), preserving the exception and traceback in logs; the missing information is primarily in the user-facing warning. Treat the fix as publishing a complete graph atomically, or clearing/marking the model dirty on failure.

Code references: app/ui/base_algorithm_ui/base_algorithm_controller.py:253, app/converters/dfg_converter.py:120.

Reviewed by **Codex (GPT-6)** against origin/main [`6bcc646eb464`](https://code.swisdata.eu/ffrauenberger/ProcessIntel/commit/6bcc646eb464e0dd897228b5e49867f65d7255c4). **Review: partially correct.** The warning and inconsistent parameter/graph state are real. Please qualify “still holds the old graph”: the fuzzy converter assigns `miner.graph = graph` **before** adding nodes and edges (dfg_converter.py:120–135), so failures there can leave a partially built replacement graph rather than the old one. Also, both cited GraphException handlers already call `logger.exception(ex)`, preserving the exception and traceback in logs; the missing information is primarily in the user-facing warning. Treat the fix as publishing a complete graph atomically, or clearing/marking the model dirty on failure. Code references: [app/ui/base_algorithm_ui/base_algorithm_controller.py:253](https://code.swisdata.eu/ffrauenberger/ProcessIntel/src/commit/6bcc646eb464e0dd897228b5e49867f65d7255c4/app/ui/base_algorithm_ui/base_algorithm_controller.py#L253), [app/converters/dfg_converter.py:120](https://code.swisdata.eu/ffrauenberger/ProcessIntel/src/commit/6bcc646eb464e0dd897228b5e49867f65d7255c4/app/converters/dfg_converter.py#L120).
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ffrauenberger/ProcessIntel#8
No description provided.