Skip to content

Commit 2325b7d

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 2de4fa2 commit 2325b7d

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
@@ -346,9 +346,6 @@ export class ProductService extends BaseService {
346346
return { products: formatted }
347347
}
348348

349-
/**
350-
* Updates the cached product list in redis
351-
*/
352349
async webhookProductUpdated(
353350
resource: ProductUpdatedResponseType,
354351
qbTokenInfo: IntuitAPITokensType,
@@ -359,9 +356,10 @@ export class ProductService extends BaseService {
359356
})
360357

361358
// 01. get all the mapped product ids with qb id
362-
const mappedConditions =
363-
(not(isNull(QBProductSync.qbItemId)),
364-
not(isNull(QBProductSync.qbSyncToken)))
359+
const mappedConditions = and(
360+
not(isNull(QBProductSync.qbItemId)),
361+
not(isNull(QBProductSync.qbSyncToken)),
362+
)
365363

366364
const mappedProducts = await this.getAllByProductId(
367365
productResource.id,

0 commit comments

Comments
 (0)