Skip to content

Conversation

@mikenikles
Copy link

Relates to #39.

This PR emits the following events:

  • start: When the download process for an object starts.
  • done: When an object has been synced downloaded.
  • error: When an error occurred.

Each event payload contains an object with:

  • filePath: The path of the processed file.
  • error: An Error in case of the error event.

Note: #39 also asks for ignore events. This PR does not include that. Happy to add that, but I would need some pointers as to where the best place for that is.

@jeanbmar
Copy link
Owner

Thank you for submitting a PR!
Sounds like a great addition, I'll review it asap.

@jeanbmar
Copy link
Owner

Sorry for the late reply, I wanted to finish the ts migration before reviewing the PR.

In order to support the events, we need to have them for the following operations:

  • CopyBucketObjectCommand
  • DownloadBucketObjectCommand
  • UploadLocalObjectCommand
  • UploadLocalObjectsCommand for multipart uploads (+ remove logic from UploadLocalObjectPartCommand)
  • DeleteBucketObjectsCommand since it probably makes sense to track delete operations too
  • A new DeleteLocalObjectsCommand to be created (logic currently happening here)

If we are implementing an event for ignored objects, it needs to be emitted in:

  • SyncLocalWithBucketCommand
  • SyncBucketWithBucketCommand
  • SyncBucketWithLocalCommand
    The isIncluded getter from SyncObject can be used for this.

We should probably change the naming a bit to avoid possible confusion between global transfer events and object events (e.g. start: objectStart)

Implementation is not hard from a technical perspective, but changes happen in a lot of commands.
If you are still up to work on this that's great, else I can make the changes, let me know :).

Thanks!

@jeanbmar jeanbmar linked an issue May 22, 2023 that may be closed by this pull request
@mikenikles
Copy link
Author

No problem, I just caught up on the changes you've made and am excited to give the newest version a go! Looking at your detailed explanation, I believe you'd be much quicker to apply these changes given your familiarity with the code.

Having said that, do let me know when you have it ready for testing and I can test it. Your library is a core piece to how the https://indexed.xyz CLI works, so thank you for keeping it maintained 😍!

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.

Emit more event about related filename and task type.

2 participants