forked from SWISDATA/processintel
ui.export: the export page crashes when no graph exists #9
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ffrauenberger/ProcessIntel#9
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: medium (Export before a genetic run shows an exception page)
Where
app/ui/export_ui/export_controller.py:96-101,:212-243app/ui/genetic_miner_ui/genetic_miner_controller.py:196-204app/io_operations/export_operations.py:59-60Problem
ExportController.process_session_statedetects a missing graph but does not stop execution:Execution continues with
self.graph = None, andexport_graph()callsExportOperations.export_graph, which raisesInvalidTypeException. That exception is not caught inExportController.run.The Genetic Miner does not mine automatically, so its graph is
Noneuntil the user clicks Run. The Export button is enabled regardless (view.display_export_button(disabled=False)runs unconditionally).Steps to reproduce
Expected behavior
The Export button is disabled while no graph exists, or the user is redirected back with the message "Graph not generated".
Actual behavior
A Streamlit exception page (
InvalidTypeException).Fix
st.rerun()(orreturn) afternavigate_toinprocess_session_state.get_graph()isNone.from
issues/BUG-009-export-page-crashes-when-no-graph-exists.md(code analysis of commit6bcc646, 2026-10-03)Reviewed by Codex (GPT-6) against origin/main
6bcc646eb464.Review: partially correct.
The missing-graph crash is supported. The proposed
returnalternative is insufficient if added only insideprocess_session_state():BaseController.start()calls that method and then unconditionally selects/renders the view and callsrun()(lines 124–130). It can therefore continue exporting despite the return, possibly also with controller attributes left unset. Usest.rerun()after the redirect,st.stop(), or an explicit status thatstart()honors. Disabling Export while the graph is absent is also appropriate.Code references: app/ui/export_ui/export_controller.py:96, app/ui/base_ui/base_controller.py:120.