Skip to content

feat(tasks): add uploading task status#88

Merged
shark0F0497 merged 4 commits into
mainfrom
feat/task-uploading-status
Jun 4, 2026
Merged

feat(tasks): add uploading task status#88
shark0F0497 merged 4 commits into
mainfrom
feat/task-uploading-status

Conversation

@shark0F0497
Copy link
Copy Markdown
Collaborator

Pull Request Checklist

Please ensure your PR meets the following requirements:

  • Code follows the style guidelines
  • Tests pass locally
  • Code is formatted
  • Documentation updated if needed
  • Commit messages follow conventional commits
  • PR description is complete and clear

Summary

This PR adds an explicit uploading task state to the recorder/transfer flow and improves task recovery observability when upload triggering or completion is retried.

It also standardizes recorder/transfer logs with device/task context, updates production dashboard task statistics, and refreshes design documentation for the callback-driven task lifecycle.


Motivation

  • Finished recordings were moving directly toward completion semantics without a durable intermediate state for "waiting for upload".
  • When upload_request could not be sent because Transfer was disconnected or timed out, operators had limited visibility into why a task remained unfinished.
  • Duplicate upload_complete events needed to remain ACK-safe without re-triggering batch/order advancement.
  • Existing logs repeated task IDs inside messages and were hard to scan during recording, auto-dispatch, cancel, and upload flows.

Changes

Modified Files

Added Files

Deleted Files

  • None

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update (documentation changes only)
  • Refactoring (code improvement without functional changes)
  • Performance improvement (code changes that improve performance)
  • Test changes (adding, modifying, or removing tests)

Impact Analysis

Breaking Changes

None.

Backward Compatibility

Fully backward compatible for API clients. Existing pre-upload task states remain accepted on upload completion for weak-network recovery, while the normal post-recording path now uses uploading.

Database migration adds the new uploading enum value and includes a rollback path that rewrites uploading tasks to in_progress before removing the enum value.


Testing

Test Environment

  • Local Keystone branch: feat/task-uploading-status
  • Go test cache redirected to /tmp/go-build to avoid read-only home cache issues

Test Cases

  • Unit tests pass locally
  • Integration tests pass locally
  • E2E tests pass (if applicable)
  • Manual testing completed

Commands run:

env GOCACHE=/tmp/go-build go test -run 'TestRecordingFinish|TestTaskHandlerAxonTransferWriteTimeout' ./internal/api/handlers/... -v
env GOCACHE=/tmp/go-build go test ./internal/api/handlers/...
env GOCACHE=/tmp/go-build GOLANGCI_LINT_CACHE=/tmp/golangci-lint golangci-lint run

Manual Testing Steps

  • Verified a recording finish flow where Keystone transitions the task to uploading and triggers Transfer upload.
  • Verified auto-dispatch of the next task after finish/upload trigger.
  • Verified cancel/clear behavior after the next task config is applied.
  • Reviewed Keystone Edge logs for structured [RECORDER][device][task] and [TRANSFER][device][task] messages.

Test Coverage

  • New tests added
  • Existing tests updated
  • Coverage maintained or improved

Screenshots / Recordings

N/A. Backend flow and documentation change.


Performance Impact

  • Memory usage: No change
  • CPU usage: No change
  • Throughput: No change
  • Lock contention: No change

Documentation


Related Issues

  • N/A

Additional Notes

  • Duplicate upload_complete remains safe: Keystone still sends upload_ack, but does not re-run batch/order advancement for tasks that were already completed.
  • upload_request send failures keep the task in uploading and write tasks.error_message for operator visibility instead of marking the task failed.

Reviewers

N/A


Notes for Reviewers

  • Please review the upload lifecycle around OnRecordingFinish, onUploadComplete, and upload_failed handling.
  • Please verify the migration rollback semantics for active uploading tasks.
  • Please review the log wording for readability during recorder/transfer troubleshooting.

Checklist for Reviewers

  • Code changes are correct and well-implemented
  • Tests are adequate and pass
  • Documentation is updated and accurate
  • No unintended side effects
  • Performance impact is acceptable
  • Backward compatibility maintained (if applicable)

@shark0F0497 shark0F0497 merged commit 054b02f into main Jun 4, 2026
5 checks passed
@shark0F0497 shark0F0497 deleted the feat/task-uploading-status branch June 4, 2026 13:01
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.

1 participant