Repository navigation
fix: address frontend template, visibility, and storage error follow-ups (#7869) - #8012
Open
MilindChatrabhuji wants to merge 5 commits into
Open
MilindChatrabhuji wants to merge 5 commits into
MilindChatrabhuji wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 15 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Contributor
[Medium impact] The reviewed changes appear safe to merge. SummaryThe PR fixes frontend template selection, cleans up visibility listeners, and shows clear errors when browser storage is blocked.
Reviews (5) · Last reviewed commit: "fix(components): keep custom modal child..." · Reviewed by Greptile |
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 6 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
This branch has not been deployed
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.
All Submissions:
Type of change
Changes To Core Features:
Summary
Fixes #7869 (follow-ups from #7794):
Prefer
packages/reflex-frontend/srcin a source checkout (reflex_base/constants/base.py,packages/reflex-base/hatch_build.py)_web_template_dir(root_dir)to preferpackages/reflex-frontend/srcwhenutils/state.jsexists there, and to requireutils/state.jsinside.templates/webbefore treating it as an embedded copy (so leftover directories such as.templates/web/.DS_Storeor stale files in a checkout never shadow the frontend package).FrontendBuildHookinpackages/reflex-base/hatch_build.pyto also requireutils/state.jswhen checking for an sdist's embedded copy.tests/units/reflex_base/constants/test_base.pyand added regression tests intest_base.pyandtests/units/test_build_config.py.Remove dead visibility branch and keep cleanup next to the socket ref (
packages/reflex-frontend/src/utils/state.js)if (!socket.current)self-removal branch fromcheckVisibility.socket.current.stopWatchingVisibilityonto thesocket.io-clientSocketinstance:connect()now attaches thevisibilitychangelistener only ifsocket.currentis still the active socket afterawait socket.current.reconnect()and returns the cleanup callback, whichuseEventLoopstores in astopWatchingVisibilityref alongside thesocketref and invokes before clearingsocket.current.packages/reflex-frontend/tests/state_connection.test.jsand added a regression test for unmounting mid-connect.Surface a clear browser-storage-blocked connection error (
packages/reflex-base/src/reflex_base/constants/event.py,packages/reflex-frontend/src/utils/state.js,packages/reflex-components-core/src/reflex_components_core/core/banner.py)ClientErrorType.STORAGE_BLOCKED = storage_blockedand matchingERROR_TYPE_STORAGE_BLOCKEDinstate.js.sessionStorage/localStorageaccess ingetToken,setToken(SecurityError), andhydrateClientStorageto throw astorage_blocked-codedError(preserving the underlyingcause) telling the user that site storage is blocked by the browser and to allow cookies/site data and reload; guarded optionallocalStoragerefresh-hint accesses inreconnectandsession_tokenerror handling, and reportednew_tokenstorage errors viasetConnectErrorsinstead of rejecting.has_storage_blocked_errorinbanner.py, handled it immediately (before the 2-error threshold, without claiming the server is unreachable) inConnectionToaster, and handled bothhas_storage_blocked_errorandhas_hydration_payload_errorindefault_connection_error()/ConnectionModal.tests/units/components/core/test_banner.py,tests/units/test_app.py,tests/units/compiler/state_js.test.mjs,packages/reflex-frontend/tests/state.test.js, andpackages/reflex-frontend/tests/state_connection.test.js.Local Verification
packages/reflex-frontend):npm run check(biome lint,tsc -p tsconfig.json,tsc -p tsconfig.node.json,vitest run: 10 files / 219 passed),biome format,npm run build(npm pack)pytest tests/units/reflex_base/constants/ tests/units/components/core/test_banner.py tests/units/compiler/test_state_js_template.py tests/units/test_build_config.py tests/units/test_app.py(497 passed, 2 skipped) and broaderpytest tests/units/reflex_base/ tests/units/components/ tests/units/compiler/ tests/units/test_app.py(8718 passed, 38 skipped)ruff check .,ruff format --check .,codespell,make_pyi.py --check,pyright --pythonplatform Linux(touched packages & tests),ty check --python-version 3.14 tests/type_checking,pyright --pythonversion 3.11/3.14 tests/type_checking,reflex-release sync --check,reflex-release changelog-check,reflex-release check-headings