Repository navigation
Conversation
If cache/{project_id}/settings/.readonly exists, app.py shows its text as a
warning above every page. DataSure only reads the marker; hosts that open a
project read-only (e.g. another user holds its write lock) create it, so
users see why edits won't be saved before they hit a write error.
This was referenced Oct 27, 2026
|
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.



Pull Request Summary 🚀
What does this PR do? 📝
If a project's settings folder contains a
.readonlymarker (cache/{project_id}/settings/.readonly), every page of that project shows the marker's text as a warning banner (:material/lock:). DataSure only reads the marker: it never creates it, never deletes it, and doesn't enforce read-only itself.Why is this change needed? 🤔
DataSure Cloud hosts the unmodified
datasurepackage from PyPI for IPA's multi-user pilot: one Linux container per signed-in user, with project state synced to Azure Blob Storage and a per-project write lock so only one person edits a project at a time. It's one of three small, independent PRs that let the hosting layer stop working around DataSure (the others: active-project signal #412, headless keyring guidance #414). When another user holds a project's write lock, or a user only has view access, DataSure Cloud opens the project read-only by making its files read-only on disk. DataSure doesn't know this, so the user's first save fails with a rawPermissionError. A marker file is the smallest contract that lets the host say why the project is read-only (for example "Being edited by someonesince 10:42 UTC") before the user loses work. Desktop users are unaffected: without the marker nothing changes.
How was this implemented? 🛠️
utils/cache_utils.py:READ_ONLY_MARKER = ".readonly"andread_only_reason(project_id) -> str | None:app.py: beforenav_menu.run(), showsst.warning(reason)when the active project has a reason. Placing it there puts it above every page.docs/ARCHITECTURE.md(marker contract, under "Cache and data locations"),CHANGELOG.mdunder[Unreleased].How to test or reproduce ? 🧪
uv run python -m pytest tests/utils/test_cache_utils.py tests/test_app.py. NewTestReadOnlyReasoncovers missing, text, empty, long and directory markers. NewTestReadOnlyNoticechecks the banner is shown with the reason and isn't shown when the project is writable.<cache>/<project_id>/settings/.readonlycontainingBeing edited by Anaand rerun the page. The banner appears on every page. Delete the file and the banner goes away.just test(4585 passed, 6 skipped);just pre-commit-runclean.Screenshots (if applicable) 📷
N/A. The banner is a standard
st.warning.Checklist ✅
Reviewer Emoji Legend
:code::smiley::+1::100:...and I want the author to know it! This is a way to highlight positive parts of a code review.
:star: :star: :star:And I am providing reasons why it needs to be addressed as well as suggested improvements.
:star: :star:And I am providing suggestions where it could be improved either in this PR or later.
:star:...and consider this a suggestion, not a requirement.
:question:This should be a fully formed question with sufficient information and context that requires a response.
:memo::pick:This does not require any changes and is often better left unsaid. This may include stylistic, formatting, or organization suggestions and should likely be prevented/enforced by linting if they really matter
:recycle:Should include enough context to be actionable and not be considered a nitpick.