Contact role updates/deletions not always syncing correctly to Salesforce#1538
Merged
Conversation
…dd forced push to salesforce on updates.
svogt0511
force-pushed
the
pb2207-salesforce-contacts-2
branch
from
June 10, 2026 02:31
fbecb8b to
e9d371b
Compare
… roles from the provider.
…don't need to do that.
jrhoads
reviewed
Jul 7, 2026
| end | ||
|
|
||
| private | ||
| =begin |
Contributor
There was a problem hiding this comment.
Seems like we would want to remove this
jrhoads
reviewed
Jul 7, 2026
| end | ||
|
|
||
| private | ||
| =begin |
Contributor
There was a problem hiding this comment.
Seems like we would want to remove this
jrhoads
reviewed
Jul 7, 2026
|
|
||
| def set_provider_role(role, contact) | ||
| def set_provider_role!(role, contact = nil) | ||
| # puts "**setting provider role #{role} contact to #{contact.email} for provider #{provider.symbol}" |
Contributor
Author
There was a problem hiding this comment.
Thanks. I thought that I had already cleaned those up.
jrhoads
approved these changes
Jul 7, 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.
Purpose
Purpose is to keep the provider/contact information in sync between the database and salesforce
Related to:
Additional pull request required for this fix: datacite/mastino#335
Additional issue regarding the salesforce sync tasks to be discussed after this is released: (https://github.com/datacite/product-backlog/issues/895) This would be for the provider and contact sync jobs. The client one stays in place because it updates the repository doi count in salesforce which is not information pushed to salesforce as part of the client update.
Approach
The first task was to keep the provider/contact information in sync in the DB. Some information is shared between the provider and its contacts. We needed to add some code to both the API provider endpoints (create/update/delete), the contact endpoints (create/update/delete), and their models to enforce synchronization of this data when changes are made.
The second task was to ensure that changes are pushed to salesforce. To this end, the calls to send updated information (send_contact_export_message and send_provider_export_message) were moved from the indexable.rb after_commit to the provider and contact models, to ensure that changes are pushed after all information has been made consistent.
The last task was to ensure that the pathway for updates from lupo to salesforce is working. This includes testing which can be done with rake tasks to push providers and contacts from lupo to salesforce. Initially this seemed to work, but ongoing inconsistent delivery of messages to salesforce led to the discovery that the salesforce-api_runner was getting 10 messages per block and only processing the first. The pull request on mastino mentioned above should take care of this issue.
We need a remediation script to be run after the release that ensures the provider/contact information is consistent in the DB, and that updated information is pushed to salesforce. All that needs to happen is to run an update on each provider. That should take care of the necessary updates.
Manual testing can be done in staging using either postman or fabrica. To ensure that the updates are pushed to salesforce, you can log into the salesforce sandbox using the info@datacite.org.sync account, or your own account if you have one. Kelly outlined some test scenarios in the issue mentioned above.
Open Questions and Pre-Merge TODOs
Then:
Learning
Types of changes
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Breaking change (fix or feature that would cause existing functionality to change)
Reviewer, please remember our guidelines: