hubspot-sfdc-conditional-overpersistence
HubSpot/SFDC Conditional Field Overpersistence
What This Skill Diagnoses
When the SFDC/HubSpot integration app is running on a stale version of the code that does not include the fix to exclude hidden conditional fields from intermediate saves, every contract initiated from HubSpot or Salesforce is created with incorrect default values for fields whose visibility conditions were not met at creation time.
Two-stage failure pattern:
-
At creation (HubSpot/SFDC save): Hidden conditional fields (fields whose conditions aren't met at the time the HubSpot widget is filled) are saved to
ContractDatawith their default values. The main UI flow usesallValuesExcludingHiddenQuestions$and handles this correctly — only the SFDC/HubSpot flow has this bug (usesallValues$instead). -
On first UI edit: When the contract is later edited in the SpotDraft UI — even editing an unrelated field — the conditional cleanup logic runs correctly, strips out all the incorrectly-saved hidden field values, and syncs back. This generates 70+ field change entries in the Activity Log and silently deletes 10+ metadata fields.
This is the opposite pattern from
questionnaire-hidden-variable-data-loss. That skill covers integration values being wiped (platform clears correct values). This skill covers hidden values being incorrectly persisted (integration saves incorrect values, platform later cleans up correctly).
Affected code path:
- Repo:
SpotDraft/angular-frontend - File:
sfdc-questionnaire-container.component.ts, method:getDataUpdateRequest(), ~line 1701 - Bug: Uses
this.questionFormService.allValues$instead ofthis.questionFormService.allValuesExcludingHiddenQuestions$ - Fix branch:
cursor/prompt-therapy-conditional-logic-03ae