Conversation
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
What changed
Data Explorer sets a browser locale in
localStorage(keydefaultLocale) every time it loads, on any dataset/resource page, before the visitor has agreed to any cookie or storage consent. This got flagged in a compliance review (Support-Services#1005) because storing anything on a visitor's device without consent is not allowed under PECR, even if it is not a cookie.Think of it like this: the app was quietly writing itself a sticky note in the visitor's browser saying "this person prefers English" the moment the page opened, without asking first. The fix removes that sticky note entirely — the app still figures out what language to show, it just stops writing it down in the visitor's browser.
Where
ckanext/dataexplorer/fanstatic/js/main.6dcb79ac.chunk.js— this is a built/minified bundle (the repo does not carry the pre-build React source), so the change is a targeted patch of thei18next-browser-languagedetectorconfig baked into that file:"cookie"and"localStorage"from the detectororderlist.caches: []so the library is explicitly told never to persist the detected locale anywhere.navigator(browser language header),htmlTag,path,subdomain— none of those touch device storage.Verified
node --checkon the patched bundle: syntax OK.defaultLocalelocalStorage write on the live York Open Data site (data.yorkopendata.org) before this fix, matching the reporter's description.Not verified
?lng=) before merging.main.6dcb79ac.chunk.jswas searched and patched.Deployment
This repo is pulled by client Dockerfiles via
pip install -e git+https://github.com/datopian/ckanext-dataexplorer-react.git. Merging this alone does not deploy anything — each client image (e.g.dx-helm-york-prod) needs a rebuild/redeploy to pick up the fix.Fixes datopian/Support-Services#1005