forked from SWISDATA/processintel
ui.algorithm_explanation: the page redirects without stopping execution #21
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ffrauenberger/ProcessIntel#21
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: low (the rest of the page still runs after the redirect)
Where
app/ui/algorithm_explanation_ui/algorithm_explanation_controller.py:49-65,:93-98Problem
algorithmis missing, the controller callsto_home(), which clears the session, and then continues tost.session_state.algorithm, which raisesAttributeError.navigate_to("Algorithm")and continues todocs_path_mappings[...], which raisesKeyError.FileNotFoundErrorbranch also navigates withoutst.rerun(), so the page renders without content until the next interaction.process_session_stateis overridden without callingsuper().process_session_state(), so pending error/info messages are not shown on this page and appear later on another page.Steps to reproduce
Expected behavior
The user is redirected with a message.
Actual behavior
A Streamlit exception page (
AttributeError/KeyError), or an empty page until the next interaction.Related: #52.
Fix
Call
st.rerun()(orreturn) after each redirect, and callsuper().process_session_state().from
issues/BUG-021-algorithm-explanation-redirects-without-rerun.md(code analysis of commit6bcc646, 2026-10-03)Reviewed by Codex (GPT-6) against origin/main
6bcc646eb464.Review: partially correct.
The redirect fallthrough findings are supported, but
returninsideprocess_session_state()is not equivalent tost.rerun().BaseController.start()continues with view selection andrun()after that method returns; the explanation controller may then read an unsetfile_pathand fail again. Use a rerun/stop or an explicit abort status handled by the outer controller. Areturncan endrun()itself in the FileNotFoundError branch, but navigation still needs the appropriate rerun. Calling the base message-processing method remains a valid correction.Code references: app/ui/algorithm_explanation_ui/algorithm_explanation_controller.py:49, app/ui/base_ui/base_controller.py:124.