fix(sync): return not_started for unsynced episodes#91
Merged
Conversation
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 Checklist
Summary
This PR changes the episode cloud sync status endpoint so an existing episode with no sync log returns a normal
not_startedstatus instead of a 404.Motivation
GET /api/v1/sync/episodes/:id/status.sync_logsrow, which previously returned404 no sync record found for this episode.Changes
Modified Files
internal/api/handlers/sync.go- Return a virtualSyncJobResponsewithstatus: "not_started"andid: 0when the episode exists but has no sync log; preserve 404 for missing or soft-deleted episodes.internal/api/handlers/sync_test.go- Add handler tests for200 not_startedand404 episode not foundbehavior.docs/designs/cloud-sync-ui-implementation.md- Document the new sync status endpoint contract.docs/designs/episode-qa-checks-mcap-integrity.zh.html- Document the updated episode detail quality-check result modal behavior.Added Files
Deleted Files
Type of Change
Impact Analysis
Breaking Changes
None
Backward Compatibility
Existing synced episodes still return the latest real sync log. Existing episodes with no sync logs now return
200 status=not_startedinstead of404; clients that treated no-sync-log 404 as normal should handle this response as the same business state.Testing
Test Environment
go run github.com/swaggo/swag/cmd/swag@v1.16.6 init -g internal/server/server.go -o docsTest Cases
Manual Testing Steps
Not performed.
Test Coverage
Commands run:
Screenshots / Recordings
Not applicable.
Performance Impact
Documentation
Related Issues
Additional Notes
not_startedis a virtual response status for this endpoint and is not inserted intosync_logs.404now means the episode is missing or soft-deleted.Reviewers
Notes for Reviewers
internal/api/handlers/sync.go.not_startedis acceptable as a virtual status for existing episodes with no sync log.Checklist for Reviewers