Skip to content

Commit 876f27a

Browse files
fix(OUT-3816): combine webhookProductUpdated guards with and()
The mapped-products filter used the comma operator, so only the qbSyncToken guard survived and the qbItemId guard was discarded — truly unmapped rows (null qbItemId) could slip into the update loop. Use and() to apply both guards. Also drop the stale "updates redis" comment. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 09be43e commit 876f27a

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/app/api/quickbooks/product/product.service.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,6 @@ export class ProductService extends BaseService {
344344
return { products: formatted }
345345
}
346346

347-
/**
348-
* Updates the cached product list in redis
349-
*/
350347
async webhookProductUpdated(
351348
resource: ProductUpdatedResponseType,
352349
qbTokenInfo: IntuitAPITokensType,
@@ -357,9 +354,10 @@ export class ProductService extends BaseService {
357354
})
358355

359356
// 01. get all the mapped product ids with qb id
360-
const mappedConditions =
361-
(not(isNull(QBProductSync.qbItemId)),
362-
not(isNull(QBProductSync.qbSyncToken)))
357+
const mappedConditions = and(
358+
not(isNull(QBProductSync.qbItemId)),
359+
not(isNull(QBProductSync.qbSyncToken)),
360+
)
363361

364362
const mappedProducts = await this.getAllByProductId(
365363
productResource.id,

0 commit comments

Comments
 (0)