fix(hubspot): Add marketing support to ReadUsingSearchAPI#2995
fix(hubspot): Add marketing support to ReadUsingSearchAPI#2995Cobalt0s wants to merge 3 commits into
Conversation
03f2b25 to
0371a6b
Compare
RajatPawar
left a comment
There was a problem hiding this comment.
Hey Constantin!
- The
isSince/isUntilflags - I'd really prefer we don't go this route. It feels quite brittle/invisible, and will add a quiet dependency to the entire hubspot chain. The marketing path would depend on the caller having usedBuildLastModifiedFilterGroup/BuildUntilTimestampFilterGroupspecifically, and anyone refactoring that could miss it very easily. Or if anyone constructs an equivalent filter by hand, we'd run a backfill.
Given that this is high-pri, my preference would be to add Since time.Time and Until time.Time directly onto SearchParams. The marketing/comm/misc branches can read them directly from SearchParams. It needs a minor server change to the hubspot search reader.
Longer term, the hubspot connector could expose a method that can tell us if an object supports search or not, and the server casts the connector & uses that method to route to the correct reader.
Also, can you please add a unit test in search_test.go for the new marketing branching logic? I don't think we have a test for ReadUsingSearchAPI for non-CRM objects. Basically, something that calls ReadUsingSearchAPI with ObjectName: "marketing/emails" with Since set
Thanks!
Makes sense. Also for future, we should be taking into considiration For now |
|
@RajatPawar the PR description was updated and it demonstrates what the changes do. Alternatively there are unit tests which you asked. For the contacts there 3 unit tests to demonstrate combinations of Since+Filter, Since, Filter. PS: The change is backwards compatible and allows Since/Until for marketing/etc and acts smartly in case of CRM. |
9e8504e to
df16099
Compare

Live Tests
ReadUsingSearchAPI
Contacts
Since can be passed in various ways:

Campaigns