Skip to content

Fix subnetwork explorer graph rendering#269

Open
prasham21 wants to merge 6 commits into
gyorilab:mainfrom
prasham21:fix-subnetwork-live-issue
Open

Fix subnetwork explorer graph rendering#269
prasham21 wants to merge 6 commits into
gyorilab:mainfrom
prasham21:fix-subnetwork-live-issue

Conversation

@prasham21
Copy link
Copy Markdown
Contributor

Description

Explorer network graphs were failing intermittently in production because graph rendering happens in a second API request after the page loads. Previously, that request relied on statement_hashes stored in Flask session. In production, requests can be handled by different Gunicorn workers, so session state was not always available to the graph API, causing it to return an empty network and show “No network data available.”

This PR makes graph rendering more robust by sending the rendered statement hashes directly in the POST /api/get_network request. The backend now prefers hashes from the request payload and only falls back to session when they are not provided.

The PR also updates Flask secret key handling so production can use a stable FLASK_SECRET_KEY across workers instead of always generating a random per-process key. This keeps session signing consistent in production while preserving the random fallback for local development.

Additionally, this removes an inline <style> block from the Vue-mounted network template to avoid Vue compile warnings, and fixes node/edge dialog positioning so detail popups open near the clicked graph item.

Changes in the modules:
src/indra_cogex/apps/templates/data_display/_network_visualization.html: remove inline dialog styles from the Vue-mounted partial.

src/indra_cogex/apps/templates/data_display/_network_visualization_js.html: send statement hashes with graph requests and place dialogs near clicked graph items.

src/indra_cogex/apps/utils.py: expose rendered statement hashes to the network visualization template.

src/indra_cogex/apps/wsgi.py: read FLASK_SECRET_KEY before falling back to a random development secret.

src/indra_cogex/client/queries.py: let get_network use request statement hashes before session fallback.

Prasham Marfatia and others added 6 commits May 7, 2026 15:07
src/indra_cogex/apps/templates/data_display/_network_visualization.html: remove inline dialog styles from the Vue-mounted partial.

src/indra_cogex/apps/templates/data_display/_network_visualization_js.html: send statement hashes with graph requests and place dialogs near clicked graph items.

src/indra_cogex/apps/utils.py: expose rendered statement hashes to the network visualization template.

src/indra_cogex/apps/wsgi.py: read FLASK_SECRET_KEY before falling back to a random development secret.

src/indra_cogex/client/queries.py: let get_network use request statement hashes before session fallback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant