Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9313142
D8878.id32008.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D8878.id32008.diff
View Options
diff --git a/cypress/e2e/vault.cy.js b/cypress/e2e/vault.cy.js
--- a/cypress/e2e/vault.cy.js
+++ b/cypress/e2e/vault.cy.js
@@ -118,6 +118,25 @@
});
+ it('should report pending cooking task when already submitted', function() {
+ // Browse a directory
+ cy.visit(this.directoryUrl);
+
+ // Stub responses when requesting the vault API to simulate
+ // an internal server error
+ cy.intercept(this.vaultDirectoryUrl, {
+ body: this.genVaultDirCookingResponse('pending', 'Processing...')
+ }).as('checkVaultCookingTask');
+
+ cy.contains('button', 'Download')
+ .click();
+
+ // Check error alert is displayed
+ cy.get('.alert-success')
+ .should('be.visible')
+ .should('contain', 'Archive cooking request already submitted');
+ });
+
it('should report an error when vault service is experiencing issues', function() {
// Browse a directory
cy.visit(this.directoryUrl);
diff --git a/swh/web/vault/assets/vault-create-tasks.js b/swh/web/vault/assets/vault-create-tasks.js
--- a/swh/web/vault/assets/vault-create-tasks.js
+++ b/swh/web/vault/assets/vault-create-tasks.js
@@ -48,7 +48,16 @@
const vaultModalId = `#vault-fetch-${objectType}-modal`;
$(vaultModalId).modal('show');
$('body').on('keyup', vaultModalId, vaultModalHandleEnterKey);
- } else {
+ } else if (data.status === 'pending') {
+ const cookingInProgressAlert =
+ $(htmlAlert('success',
+ 'Archive cooking request already submitted.<br/>' +
+ `Go to the <a href="${Urls.vault()}">Downloads</a> page ` +
+ 'to get the download link once it is ready.',
+ true));
+ cookingInProgressAlert.css(alertStyle);
+ $('body').append(cookingInProgressAlert);
+ } else if (!response.ok) {
const cookingServiceDownAlert =
$(htmlAlert('danger',
'Archive cooking service is currently experiencing issues.<br/>' +
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jul 2, 11:25 AM (1 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3231065
Attached To
D8878: vault/assets: Fix cooking task creation when there is a pending one
Event Timeline
Log In to Comment