Fix subnetwork explorer graph rendering#269
Open
prasham21 wants to merge 6 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.