Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(hub-common): allow force updates of cache files as well as cache status reporting #1657

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

sonofflynn89
Copy link
Contributor

@sonofflynn89 sonofflynn89 commented Sep 19, 2024

  1. Description:

Part of https://devtopia.esri.com/dc/hub/issues/11445

This PR is meant to reflect new realities in our Download API, namely:

  • If the download api serves us a cached file, we propagate the status of that cache to the caller
  • Allow callers of fetchDownloadFile() to update the cache by providing the "updateCache" option

As an aside, we decided to remove the implicit requirement that fetchDownloadFile() would call progressCallback with a completed status. It's now up to the callers of fetchDownloadFile() to inform interested parties that the download is complete.

  1. Updated meaningful TSDoc to methods including Parameters and Returns, see Documentation Guide

  2. used semantic commit messages

  3. PR title follows semantic commit format (CRITICAL if the title is not in a semantic format, the release automation will not run!)

@sonofflynn89 sonofflynn89 changed the title F/11445 add cachestatus and updatecache feat(hub-common): allow force updates of cache files as well as cache status reporting Sep 19, 2024
@@ -53,7 +53,6 @@ export async function fetchExportImageDownloadFile(
// }

const blob: Blob = await request(`${entity.url}/exportImage`, requestOptions);
progressCallback && progressCallback(DownloadOperationStatus.COMPLETED);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As part of this PR, we made the decision that fetchDownloadFile() delegates are no longer responsible for emitting the "complete" event. It is up to the caller of fetchDownloadFile() to notify that the download is complete.

};
}

// Operation still in progress, poll again
// Operation still in progress. Report progress if a callback was provided and poll again.
progressCallback && progressCallback(operationStatus, progressInPercent);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving this for the same reason as above. We don't want to emit the "complete" event from within this function.

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