diff --git a/src/app/core/data/bitstream-data.service.ts b/src/app/core/data/bitstream-data.service.ts index 2e507173df..f755f9e4dc 100644 --- a/src/app/core/data/bitstream-data.service.ts +++ b/src/app/core/data/bitstream-data.service.ts @@ -137,12 +137,23 @@ export class BitstreamDataService extends IdentifiableDataService imp sendRequest(this.requestService), take(1) ).subscribe(() => { - this.requestService.removeByHrefSubstring(bitstream.self + '/format'); + this.deleteFormatCache(bitstream); }); - return this.rdbService.buildFromRequestUUID(requestId); } + private deleteFormatCache(bitstream: Bitstream) { + const bitsreamFormatUrl = bitstream.self + '/format'; + this.requestService.setStaleByHrefSubstring(bitsreamFormatUrl); + // Delete also cache by uuid as the format could be cached also there + this.objectCache.getByHref(bitsreamFormatUrl).pipe(take(1)).subscribe((cachedRequest) => { + const requestUuid = cachedRequest.requestUUIDs[0]; + if (this.requestService.hasByUUID(requestUuid)) { + this.requestService.setStaleByUUID(requestUuid); + } + }); + } + /** * Returns an observable of {@link RemoteData} of a {@link Bitstream}, based on a handle and an * optional sequenceId or filename, with a list of {@link FollowLinkConfig}, to automatically diff --git a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.ts index d7e279586f..6351c86934 100644 --- a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.ts +++ b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.ts @@ -203,7 +203,7 @@ export class ItemEditBitstreamBundleComponent implements OnInit, OnDestroy { switchMap(() => this.bundleService.getBitstreams( this.bundle.id, paginatedOptions, - followLink('format', { useCachedVersionIfAvailable: false }), + followLink('format'), )), ); }),