Skip to content

fix: check frontend's app matches server's app in run mode#449

Merged
mscolnick merged 2 commits into
mainfrom
aka/fix-instantiate-edge-case-run-mode
Dec 12, 2023
Merged

fix: check frontend's app matches server's app in run mode#449
mscolnick merged 2 commits into
mainfrom
aka/fix-instantiate-edge-case-run-mode

Conversation

@akshayka

Copy link
Copy Markdown
Contributor

This change makes the server token in run mode a hash of the code, to prevent frontends made for one app from trying to instantiate on a server serving a different app. This still allows frontends to connect to a server that died and came back as long as the server is serving the same app.

This change makes the server token in run mode a hash of the code,
to prevent frontends made for one app from trying to instantiate on
a server serving a different app. This still allows frontends
to connect to a server that died and came back as long as the server
is serving the same app.
@vercel

vercel Bot commented Dec 12, 2023

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marimo-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 12, 2023 5:13am
marimo-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 12, 2023 5:13am

Comment on lines +417 to +423
else:
# Because run-mode is read-only, all that matters is that
# the frontend's app matches the server's app.
assert app is not None
self.server_token = str(
hash("".join(code for code in app._codes()))
)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main change

@mscolnick
mscolnick merged commit 6c38c26 into main Dec 12, 2023
@mscolnick
mscolnick deleted the aka/fix-instantiate-edge-case-run-mode branch December 12, 2023 17:16
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants