fix(config): load rxconfig with cwd prepended - #6933
Conversation
… sys.path, racing concurrent first-time imports
_load_config cleared sys.path down to the cwd for the duration of the
rxconfig import, so any concurrent first-time import in another thread
failed with ModuleNotFoundError (e.g. the lazy granian import when the
backend starts while another thread loads the config). Prepending the cwd
keeps the same resolution priority without blinding other threads.
Dropping the clear also removes the except-retry fallback, which had been
papering over a second bug: find_spec("rxconfig") answers from sys.modules,
so a leftover module from another project directory faked the existence
probe. Evict rxconfig from sys.modules before probing instead.
Greptile SummaryThe PR makes rxconfig loading preserve the process import path during concurrent imports and records project-local dependencies only from the loading thread.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| packages/reflex-base/src/reflex_base/config.py | Reworks rxconfig import-path handling and dependency recording without leaving a blocking correctness issue. |
| tests/units/test_config.py | Adds regression coverage for concurrent imports, caller-owned cwd entries, and dependency attribution. |
| packages/reflex-base/news/6933.bugfix.md | Documents the corrected concurrent-import and stale-module behavior. |
Reviews (3): Last reviewed commit: "fix: don't misattribute concurrent impor..." | Re-trigger Greptile
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
All reported issues were addressed
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
…y the inserted cwd entry
Uh oh!
There was an error while loading. Please reload this page.