Commit d8d9838
authored
fix(harmonic): correct the destructive-clear copy and stop double-billing enrichment (#6915)
* fix(harmonic): correct the destructive-clear copy and stop double-billing enrichment
Follow-up to #6902, from a final validation pass against Harmonic's OpenAPI and
API reference. No endpoint, method, or response mapping changed.
- The `personUrns` field told users and the LLM that Clear Net-New Results
"clears everything when omitted". That is the raw provider behavior the
clearScope guard was added to block; omitting it now throws. The field is
shared across three operations, so the wrong sentence was being served as
guidance on all of them.
- Bulk email enrichment deduplicated LinkedIn URLs before canonicalising them,
so `.../in/foo?utm_source=x` and `.../in/foo` were submitted as two people.
Harmonic bills per submitted entry, so this spent quota twice and
double-counted against the 5,000 cap. Deduplicate after canonicalising.
- The two documented bulk-enrichment failures carry a code in `error` and no
message anywhere, so quota exhaustion surfaced as "Request failed with status
429". Render the code with its counters instead. Gated on those counters being
present: `extractErrorMessage` without an explicit id walks every extractor in
order, and claiming a bare `error` key swallowed OAuth's `error_description`.
- An enrichment 404 whose detail carries only the URN no longer discards it.
- Report the identifier conflict before complaining about an individual URL.
- Validate `companyContextUrns` as company URNs, like every other URN param.
Forward-compat: `user_saved_search_type` is passed through rather than checked
against a fixed set. It is display metadata nothing branches on, and Harmonic
owns the enum — an allow-list turned any value they add into a hard failure of
the whole list while the selector reading the same rows kept working.
Also drops `USER_CONNECTION`, which Harmonic documents as unsupported via the
API, removes three superseded types and one dead helper, and extends the
"credential never reaches a URL or body" assertion from 4 tools to all 13.
* fix(harmonic): fold equivalent profile URLs and stop blank entries failing a batch
Review round on #6915.
- Blank and non-string `personLinkedinUrls` entries are dropped before the
mutual-exclusivity check. Moving the filter after per-URL validation meant a
list like `['']` alongside person URNs reported "not both" — naming a conflict
the caller never created — or failed the URL parse instead of reading as absent.
- Deduplicate on a profile key rather than the canonical string, so
`linkedin.com/in/x`, `www.linkedin.com/in/x` and a trailing slash count once.
Harmonic canonicalizes and silently deduplicates server-side and reserves quota
afterwards, so this does not change what is billed; it keeps Sim's own 1-5000
accounting in step with the set Harmonic accepts, so a batch of equivalent URLs
is not rejected locally for a cap it never reaches.
Regional subdomains stay distinct: folding `uk.linkedin.com` into `www.` would
assert an equivalence Harmonic does not document, and the URL kept for display
must remain the one the caller supplied.
* fix(harmonic): fold only recognized profile URLs, never pass-through ones
Review round on #6915. The profile key added last round was applied to every
entry, but it is built from host and path alone. A URL forwarded verbatim for
Harmonic to adjudicate keeps its query, port and fragment significant, so two
distinct identifiers collapsed to one key and the later one was dropped before
Harmonic ever saw it.
The key now applies only to a URL `normalizeLinkedinProfileUrl` already
canonicalized — where the query and fragment are gone by construction, so folding
host and trailing slash is safe. Anything passed through deduplicates on its exact
text.1 parent 5b28da1 commit d8d9838
5 files changed
Lines changed: 263 additions & 56 deletions
File tree
- apps/sim
- blocks/blocks
- tools
- harmonic
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
| 361 | + | |
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
| |||
838 | 838 | | |
839 | 839 | | |
840 | 840 | | |
841 | | - | |
| 841 | + | |
842 | 842 | | |
843 | 843 | | |
844 | 844 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
| 216 | + | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
245 | 244 | | |
246 | 245 | | |
| 246 | + | |
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
250 | 268 | | |
251 | 269 | | |
252 | 270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
233 | 234 | | |
234 | 235 | | |
235 | 236 | | |
| |||
238 | 239 | | |
239 | 240 | | |
240 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
241 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
242 | 271 | | |
243 | 272 | | |
244 | 273 | | |
| |||
336 | 365 | | |
337 | 366 | | |
338 | 367 | | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
339 | 375 | | |
340 | 376 | | |
341 | 377 | | |
| |||
564 | 600 | | |
565 | 601 | | |
566 | 602 | | |
567 | | - | |
568 | 603 | | |
569 | 604 | | |
570 | 605 | | |
| |||
579 | 614 | | |
580 | 615 | | |
581 | 616 | | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
582 | 625 | | |
583 | 626 | | |
584 | 627 | | |
| |||
929 | 972 | | |
930 | 973 | | |
931 | 974 | | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
932 | 984 | | |
933 | 985 | | |
934 | 986 | | |
| |||
1098 | 1150 | | |
1099 | 1151 | | |
1100 | 1152 | | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
1101 | 1263 | | |
1102 | 1264 | | |
1103 | 1265 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | 123 | | |
142 | 124 | | |
143 | 125 | | |
| |||
0 commit comments