Repository navigation
[Core] Fix state dictionary keys in JavaScript updates - #1871
Open
UmutAlisoglu wants to merge 1 commit into
Open
UmutAlisoglu wants to merge 1 commit into
UmutAlisoglu wants to merge 1 commit into
Conversation
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
window.state['item-count'] = 420updates Python state but leaves the JavaScript value undefined: the bridge inserts dictionary keys into dot-property expressions. Use JSON-quoted bracket access for assignment and deletion instead.Adds one native regression test covering hyphens, spaces, quotes and backslashes. It fails on unchanged master and passes with this fix. No public API or dependency changes.
Affected backends
webview/state.pyonly)Tested locally on Windows, Python 3.11.9, WinForms/EdgeChromium (WebView2). Other backends, including WinUI 3, are untested locally.
Checklist
python tests/run.py: 181 passed, 5 skipped.pre-commit run --all-filespasses: this Windows checkout has text placeholders for tracked symlinks, causing existing EOF/Ruff failures. Full Ruff lint and format pass excludingtests/android/shared, where the Python link placeholders reside; no exclusions were committed.docs/CHANGELOG.md.AI-assisted with OpenAI Codex; before/after reproduction and the test results above were run locally.