Closed jonathanstegall closed 2 years ago
Just noting that there are also the salesforce_pulling_object_id
and salesforce_pushing_object_id
transients that get set when a specific record is pulled or pushed. I think these transients would probably both also need to store the fieldmap ID, in this model. Otherwise it's still going to be confused if there are multiple fieldmaps on the same object.
Option values to update/consider updating for this issue:
object_sync_for_salesforce_pull_last_sync
(no, this should still be plugin-wide)object_sync_for_salesforce_pull_last_sync_{$type}
object_sync_for_salesforce_currently_pulling_query_{$type}
object_sync_for_salesforce_pull_merge_last_{$type}
object_sync_for_salesforce_pull_delete_last_{$type}
Transient values to update/consider updating for this issue:
salesforce_merged_{$type}
salesforce_pushing_object_id
salesforce_pushing_{$mapping_object_id_transient}
salesforce_pulling_{$object_id}
salesforce_pulling_object_id
These values are used in a lot of places in the push and pull classes. If we start to change them to store the fieldmap ID, we would want to make some more centralized methods for setting and retrieving the values.
I think we at least need to update the values that are option values. I'm not sure that we actually have to deal with the transients, they might be fine as they are.
I think we do need to update the transients.
Describe the bug See this thread. The issue is that the LastModifieDate (or whatever the date field the fieldmap uses) gets stored in
wp_options
based on the Salesforce object type.An example of this is the
object_sync_for_salesforce_pull_last_sync_Contact
field, which gets updated with a timestamp value whenever a pull query runs.To Reproduce Steps to reproduce the behavior:
Expected behavior I think it's reasonable to store the timestamp based on what fieldmap it is, rather than what Salesforce object type it is. I think this requires a lot of testing, both to make sure it doesn't have unforeseen consequences and to make sure it doesn't cause problems when switching from one method to the other, but it seems reasonable before doing any of that.