Skip to content

feat: add resume capability for failed uploads - #50

Merged
neuromechanist merged 2 commits into
devfrom
feature/resume-failed-uploads
Jan 21, 2026
Merged

neuromechanist merged 2 commits into
devfrom
feature/resume-failed-uploads

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

  • Add local config storage in .nemar/config.json to track dataset metadata
  • Detect existing config and resume upload with fresh presigned URLs
  • Update last upload timestamp on successful completion

Implementation

  • New file src/lib/dataset-config.ts for local config management
  • Modified src/commands/dataset.ts to check for existing config before upload
  • If config exists, skip dataset creation and request fresh presigned URLs

What this solves

If S3 upload fails mid-way, user can run nemar dataset upload again and it will:

  1. Detect the existing dataset (via .nemar/config.json)
  2. Get fresh presigned URLs from backend
  3. Re-upload files (git-annex naturally handles duplicates)

Not in scope (future work)

  • Incremental push for new files added after initial upload
  • nemar dataset push command for ongoing updates
  • See related discussion about broader push/commit workflow

Test plan

  • Upload new dataset, verify .nemar/config.json created
  • Simulate failure, re-run upload, verify resume
  • Verify last_upload_at timestamp updates

Closes #45

- Add local config storage in .nemar/config.json
- Store dataset_id, github_url, s3_prefix after initial creation
- Detect existing config and resume with fresh presigned URLs
- Update last_upload_at timestamp on successful completion

Closes #45
- Remove unused import hasLocalConfig
- Consolidate duplicate readLocalConfig calls
- Remove dead code (!dataset check)
- Add validation when reading config from JSON
- Check HTTP statusCode instead of string matching
- Add error logging for silent failures
- Remove unused getLocalDatasetId function
@github-actions

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR50

Version: 0.3.4-PR50.f231771
Commit: f231771


🤖 Updated on each push.

This branch was previously deployed

1 inactive deployment
npm — f2317716 Deployed Jan 21, 2026 by neuromechanist
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.

Add resume capability for failed uploads

1 participant