Skip to content

[codex] Add public data sync settings endpoint#2

Merged
Eoic merged 1 commit into
masterfrom
codex/online-data-sync-settings
Jun 27, 2026
Merged

[codex] Add public data sync settings endpoint#2
Eoic merged 1 commit into
masterfrom
codex/online-data-sync-settings

Conversation

@Eoic

@Eoic Eoic commented Jun 27, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds a public GET /v1/sync/settings discovery endpoint for custom server setup.
  • Returns user-facing data sync URL plus file storage capability/quota without exposing implementation names in the response.
  • Adds the default 1 GB file storage quota setting.

Validation

  • .venv/bin/ruff check papyrus/api/routes/sync.py papyrus/config.py papyrus/schemas/sync.py tests/api/routes/test_sync.py
  • .venv/bin/pytest tests/api/routes/test_sync.py::test_sync_settings_are_public_and_hide_implementation_details -q
  • .venv/bin/pytest -q

@Eoic Eoic marked this pull request as ready for review June 27, 2026 15:03
Copilot AI review requested due to automatic review settings June 27, 2026 15:03
@Eoic Eoic merged commit 8bff186 into master Jun 27, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a public sync “discovery” endpoint under the existing Sync router to support custom server setup, exposing a client-facing sync URL plus file-storage capability/quota, and introduces a default file storage quota setting.

Changes:

  • Add GET /v1/sync/settings returning data_sync_url and file_storage capability/quota.
  • Introduce new Pydantic response schemas for the sync settings payload.
  • Add a default file_storage_quota_bytes setting and a route test covering the new public endpoint and implementation-name hiding.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
tests/api/routes/test_sync.py Adds contract test for the new public sync settings endpoint.
papyrus/schemas/sync.py Adds response models for sync settings and file-storage capability/quota.
papyrus/config.py Adds default file storage quota setting.
papyrus/api/routes/sync.py Adds GET /settings handler returning the discovery payload.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread papyrus/schemas/sync.py
Comment on lines +72 to +73
supported: bool
quota_bytes: int
Comment thread papyrus/schemas/sync.py
Comment on lines +79 to +80
data_sync_url: str
file_storage: FileStorageSettings
Comment on lines +31 to +33
settings = get_settings()
return DataSyncSettingsResponse(
data_sync_url=settings.powersync_service_url,
Comment thread papyrus/config.py
powersync_token_expire_minutes: int = 5
powersync_service_url: str = "http://localhost:8081"
powersync_service_port: int = 8081
file_storage_quota_bytes: int = 1_073_741_824
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