Skip to content

fix(sunset): include sunset_url in the 410 export-only body - #2022

Merged
MODSetter merged 2 commits into
MODSetter:devfrom
MannXo:fix/1938-sunset-url-in-410
Sep 29, 2026
Merged

MODSetter merged 2 commits into
MODSetter:devfrom
MannXo:fix/1938-sunset-url-in-410

Conversation

@MannXo

@MannXo MannXo commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

What

The export-only 410 Gone now carries sunset_url next to detail:

{"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 sets SUNSET_URL changes the GET /health field and the 410 together. The quote in the "Refusing writes" section of docs/architecture/sunset.md is 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.py

Two new tests in test_sunset_write_block.py cover the default URL and a custom SUNSET_URL. The first failed before the change. The sunset tests are 150 passed, and check_docs.py reports 0 problems. The full pytest -m unit run 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 on dev without this change, on macOS, where the long filename does not raise OSError.

High-level PR Summary

Adds a machine-readable sunset_url field 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 calling GET /health. The URL value is sourced from the existing sunset_url() function, ensuring consistency with the health endpoint and respecting the SUNSET_URL environment variable.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_backend/tests/unit/test_sunset_write_block.py
2 surfsense_backend/app/sunset.py
3 docs/architecture/sunset.md

Need help? Join our Discord

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
@vercel

vercel Bot commented Sep 29, 2026

Copy link
Copy Markdown

@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.

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 25d8ef62-fee8-44ad-8277-01b5ad486735

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…-410

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	docs/architecture/sunset.md
@MODSetter
MODSetter merged commit 9c41cbd into MODSetter:dev Sep 29, 2026
6 of 7 checks passed

This branch was successfully deployed

1 active deployment
Preview — 1c37f999 Deployed Sep 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants