[codex] Add public data sync settings endpoint#2
Merged
Conversation
There was a problem hiding this comment.
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/settingsreturningdata_sync_urlandfile_storagecapability/quota. - Introduce new Pydantic response schemas for the sync settings payload.
- Add a default
file_storage_quota_bytessetting 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 on lines
+72
to
+73
| supported: bool | ||
| quota_bytes: int |
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, |
| 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 |
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.
Summary
GET /v1/sync/settingsdiscovery endpoint for custom server setup.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