Skip to content

Loosing the params send from front end App while the worker is reloading. #492

@silsila

Description

@silsila

I have a React.js application where I embed a Jupyter Notebook served via a Mercury (Docker) server using an iframe. I'm passing environment-specific variables (like URLs, IDs) through the iframe URL to the notebook. This works correctly on the initial load.

However, the issue occurs when the Mercury app refreshes or the worker is reloaded. In such cases, the notebook loses the data that was initially passed from the React application via the iframe.

Here’s what I’ve tried:

Storing the data in sessionStorage using JavaScript within the notebook.

Successfully storing the values, but when trying to retrieve and send them back to Python using JavaScript (via window.IPython.notebook.kernel.execute() or similar), it fails

My questions:
Is there a recommended way to persist data across worker reloads in Mercury?

Can you suggest a robust method to retrieve session data (from sessionStorage or elsewhere) and safely pass it back into the Python kernel?

Is there a better architecture for passing data from the parent React app to the Mercury notebook that survives refreshes?

Any help would be greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions