diff --git a/Packages/ohif-study-list/client/lib/OHIFStudyMetadataSource.js b/Packages/ohif-study-list/client/lib/OHIFStudyMetadataSource.js index c01e88b61..22baafd2e 100644 --- a/Packages/ohif-study-list/client/lib/OHIFStudyMetadataSource.js +++ b/Packages/ohif-study-list/client/lib/OHIFStudyMetadataSource.js @@ -13,9 +13,7 @@ export class OHIFStudyMetadataSource extends OHIF.viewerbase.StudyMetadataSource * @return {Promise} A Promise object */ getByInstanceUID(studyInstanceUID) { - return new Promise((resolve, reject) => { - getStudyMetadata(studyInstanceUID, resolve, reject); - }); + return OHIF.studylist.retrieveStudyMetadata(studyInstanceUID); } /** diff --git a/Packages/ohif-study-list/client/lib/retrieveStudyMetadata.js b/Packages/ohif-study-list/client/lib/retrieveStudyMetadata.js index f5d422479..d09455555 100644 --- a/Packages/ohif-study-list/client/lib/retrieveStudyMetadata.js +++ b/Packages/ohif-study-list/client/lib/retrieveStudyMetadata.js @@ -13,6 +13,11 @@ const StudyMetaDataPromises = new Map(); * @returns {Promise} that will be resolved with the metadata or rejected with the error */ OHIF.studylist.retrieveStudyMetadata = studyInstanceUid => { + + // @TODO: Whenever a study metadata request has failed, its related promise will be rejected once and for all + // and further requests for that metadata will always fail. On failure, we probably need to remove the + // corresponding promise from the "StudyMetaDataPromises" map... + // If the StudyMetaDataPromises cache already has a pending or resolved promise related to the // given studyInstanceUid, then that promise is returned if (StudyMetaDataPromises.has(studyInstanceUid)) {