Repository navigation
fix(sunset): include sunset_url in the 410 export-only body - #2022
Conversation
The 410 now carries the same sunset_url() that GET /health reads, so a client refused a write can reach the sunset page without a second call. Fixes MODSetter#1938
|
@MannXo is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
…-410 Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # docs/architecture/sunset.md
What
The export-only
410 Gonenow carriessunset_urlnext todetail:{"detail": "SurfSense is export-only while the hosted service winds down. Your data is still available to export.", "sunset_url": "https://surfsense.com/sunset"}The value comes from the existing
sunset_url(), so a deployment that setsSUNSET_URLchanges theGET /healthfield and the 410 together. The quote in the "Refusing writes" section ofdocs/architecture/sunset.mdis updated and the Known gaps line is deleted.Why
A client refused a write had no machine-readable way to reach the sunset page without already knowing to call
GET /health.Fixes #1938
How to test
cd surfsense_backend EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2 uv run pytest -m unit -k sunset uv run ruff check app/sunset.py tests/unit/test_sunset_write_block.py python ../scripts/check_docs.pyTwo new tests in
test_sunset_write_block.pycover the default URL and a customSUNSET_URL. The first failed before the change. The sunset tests are 150 passed, andcheck_docs.pyreports 0 problems. The fullpytest -m unitrun is 3398 passed with 1 failure,test_naming_byte_length.py::test_derived_name_is_writable_where_raw_title_is_not. That one fails the same way ondevwithout this change, on macOS, where the long filename does not raiseOSError.High-level PR Summary
Adds a machine-readable
sunset_urlfield to the 410 Gone response when the service is in sunset mode. Previously, clients receiving write rejections had no automated way to discover the sunset page URL without callingGET /health. The URL value is sourced from the existingsunset_url()function, ensuring consistency with the health endpoint and respecting theSUNSET_URLenvironment variable.⏱️ Estimated Review Time: 5-15 minutes
💡 Review Order Suggestion
surfsense_backend/tests/unit/test_sunset_write_block.pysurfsense_backend/app/sunset.pydocs/architecture/sunset.md