chore: remove oai-pmh sync dead code - #2903
Open
fpotier wants to merge 3 commits into
Open
Conversation
fpotier
marked this pull request as ready for review
August 26, 2026 07:50
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/published-data/published-data.controller.ts" line_range="616" />
<code_context>
- return res ? { doi: res.data } : null;
- }
+ return res;
}
</code_context>
<issue_to_address>
**issue:** The resync endpoint documentation still says that the endpoint synchronizes with the OAI Provider and returns the OAI resynchronization result or null, but the implementation no longer calls OAI and now returns `{ doi: publishedData.doi }` after only updating MongoDB.
**Suggested fix:** Update the `@ApiOperation`/`@ApiResponse` descriptions and surrounding comments to describe the new local-update behavior, or remove the deprecated resync routes if they are no longer supported.
</issue_to_address>
### Comment 2
<location path="src/published-data/published-data.controller.ts" line_range="614-616" />
<code_context>
- } catch (error) {
- console.error(error);
- }
+ const res = await this.publishedDataService.update(filter, data);
- return res ? { doi: res.data } : null;
- }
+ return res;
}
</code_context>
<issue_to_address>
**issue (bug_risk):** The register endpoint changes its response from `{ doi: res.data }`, where `res.data` is the Datacite registration result, to the entire value returned by `publishedDataService.update`, exposing the complete published-data document and changing the endpoint's response contract despite the method still being declared as `Promise<IRegister | null>`.
**Triggers:** When clients consume the response of `POST /publisheddata/:id/register`.
**Suggested fix:** Preserve the previous response shape by returning `{ doi: res?.doi }` or explicitly update the endpoint's DTO, return type, and documented API contract if the full document is intentional.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Junjiequan
approved these changes
Aug 26, 2026
fpotier
force-pushed
the
delete-oaipmh-resync
branch
from
August 27, 2026 12:06
d3484b3 to
afa63c7
Compare
minottic
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Remove dead code for OAI-PMH sync.
Motivation
This feature is no longer supported by the oai-provider service and it seems like it was only used by PSI who is now using Datacite API directly.
Fixes
Changes:
Tests included
Documentation
official documentation info
Summary by Sourcery
Remove unsupported OAI-PMH synchronization and streamline published-data updates around DataCite registration.
Enhancements:
Documentation:
Tests:
Chores: