feat(sync): show episode upload progress#93
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
Please ensure your PR meets the following requirements:
Summary
This PR adds runtime upload progress support for single episode cloud sync. Keystone now captures OSS multipart upload progress in memory, exposes it through sync status APIs, and documents the design tradeoffs.
Motivation
pending,in_progress,completed, andfailed, but not how far an active episode cloud sync has progressed.Changes
Modified Files
internal/cloud/uploader.go- Adds an optional upload progress callback and reports progress after each successful OSS multipart part.internal/cloud/uploader_test.go- Covers successful progress callbacks and ensures failed parts do not advance progress.internal/services/sync_worker.go- Tracks in-memory per-episode sync progress and clears it when sync reaches a terminal state.internal/services/sync_worker_test.go- Covers progress set/get and immediate cleanup behavior.internal/api/handlers/sync.go- Extends single episode status responses and addsGET /api/v1/sync/episode-statuses?ids=...for batched status polling.internal/api/handlers/sync_test.go- Covers batched status responses, partial missing IDs, and invalid ID validation.Added Files
docs/designs/single-episode-cloud-sync-progress.zh.html- Design document for the runtime-only single episode cloud sync progress feature.Deleted Files
Type of Change
Impact Analysis
Breaking Changes
None
Backward Compatibility
Fully backward compatible. Existing sync endpoints remain available, and progress is returned only as optional runtime metadata.
Testing
Test Environment
GOCACHE=/tmp/go-build-cachehttptestTCP listeners, so targeted package/test runs were used for the affected packages.Test Cases
Manual Testing Steps
Not performed.
Test Coverage
Commands run:
Full
./internal/servicesand./internal/api/handlerspackage runs were not used because this sandbox rejects local TCP listeners used by existing WebSocket tests.Screenshots / Recordings
Not applicable for backend changes.
Performance Impact
Documentation
Related Issues
Additional Notes
sync_logs.GET /api/v1/sync/episode-statusesis used instead of/sync/episodes/statusto avoid route conflicts with existing:idroutes.Reviewers
Notes for Reviewers
SyncWorkerprogress map.Checklist for Reviewers