diff --git a/pass-deposit-services/deposit-core/src/main/java/org/eclipse/pass/deposit/service/DepositTask.java b/pass-deposit-services/deposit-core/src/main/java/org/eclipse/pass/deposit/service/DepositTask.java index 1bbbe476..18cedc50 100644 --- a/pass-deposit-services/deposit-core/src/main/java/org/eclipse/pass/deposit/service/DepositTask.java +++ b/pass-deposit-services/deposit-core/src/main/java/org/eclipse/pass/deposit/service/DepositTask.java @@ -439,7 +439,11 @@ static Function performDeposit(DepositWorkerContext try (TransportSession transportSession = transport.open(packagerConfig)) { TransportResponse tr = transportSession.send(packageStream, packagerConfig, deposit); deposit.setDepositStatus(DepositStatus.SUBMITTED); - deposit.setDepositStatusRef(packageStream.metadata().packageDepositStatusRef()); + + // Only set deposit status ref if not already set during transport + if (deposit.getDepositStatus() == null) { + deposit.setDepositStatusRef(packageStream.metadata().packageDepositStatusRef()); + } return tr; } catch (Exception e) { throw new RuntimeException("Error closing transport session for deposit " + diff --git a/pass-deposit-services/deposit-core/src/main/java/org/eclipse/pass/deposit/service/SubmissionProcessor.java b/pass-deposit-services/deposit-core/src/main/java/org/eclipse/pass/deposit/service/SubmissionProcessor.java index 3f9e03b2..8a8fc86e 100644 --- a/pass-deposit-services/deposit-core/src/main/java/org/eclipse/pass/deposit/service/SubmissionProcessor.java +++ b/pass-deposit-services/deposit-core/src/main/java/org/eclipse/pass/deposit/service/SubmissionProcessor.java @@ -291,9 +291,7 @@ private static boolean isSubmittedByUser(Submission submission) { static Collection getLookupKeys(Repository repo) { final List keys = new ArrayList<>(); - ofNullable(repo.getName()).ifPresent(keys::add); ofNullable(repo.getRepositoryKey()).ifPresent(keys::add); - ofNullable(repo.getId()).map(Object::toString).ifPresent(keys::add); return keys; } diff --git a/pass-deposit-services/deposit-core/src/main/java/org/eclipse/pass/deposit/transport/dspace/DSpaceSession.java b/pass-deposit-services/deposit-core/src/main/java/org/eclipse/pass/deposit/transport/dspace/DSpaceSession.java index 5c557eb7..c6277043 100644 --- a/pass-deposit-services/deposit-core/src/main/java/org/eclipse/pass/deposit/transport/dspace/DSpaceSession.java +++ b/pass-deposit-services/deposit-core/src/main/java/org/eclipse/pass/deposit/transport/dspace/DSpaceSession.java @@ -77,9 +77,6 @@ public TransportResponse send(PackageStream packageStream, Map m // Use the deposit status ref to mark that the workspace item was created deposit.setDepositStatusRef(String.valueOf(workspaceItemId)); - - // TODO what about packageStream.metadata() package ref, it will overwrite? - passClient.updateObject(deposit); LOG.debug("Created WorkspaceItem: {}", workspaceItemId);