Known Bugs — Engineering Triage (Roadmap "E")¶
Engineering triage of the PM's Excel "E" bugs (E1.1-E1.12, Roadmap §E). Each entry: the bug, a root-cause hypothesis grounded in code areas from the maps, where to look, and a validation approach. All statuses: Pending (hypotheses to confirm, not confirmed diagnoses).
Validation legend: ✅ verified area · 📄 hypothesis · ⚠️ links to debt item
E1.1 — ROI calculation rectification · P0 · Pending¶
- Bug: campaign ROI figures are wrong.
- Hypothesis 📄: ROI attribution window / revenue-vs-spend join is inconsistent across the three campaign pipelines (debt D5); dynamic-coupon ROI path computes differently from the standard path.
- Where to look:
processLibrary/campaignMis.js,uengageProcessDynamicCouponCodeROICalculationHelper.js,auto_campaign_roi,campaign_mis;campaignControllerDynamic.getROIForCampaign. - Validate: pick one campaign; recompute ROI = attributed revenue / spend by hand within the configured window; compare against each pipeline. Confirm the window matches roadmap B3.7 (dynamic per-campaign window).
E1.2 — Loyalty metrics rectification · P0 · Pending¶
- Bug: loyalty dashboard metrics don't reconcile.
- Hypothesis 📄: metrics read from MongoDB
wallet_config/wallet_transactionswhile truth lives partly in MySQL wallet tables — the non-atomic split (debt D2) makes aggregates drift. - Where to look:
controllers/loyaltyController.js,walletController.js,commonFunctions/handleWalletPointsFlow.js; MySQLwallet,wallet_history,wallet_rules. - Validate: for a sample of customers, recompute earned/used/available from
wallet_transactionsand compare to displayed metrics; quantify Mongo↔MySQL delta.
E1.3 — WhatsApp volume reports inaccurate · P0 · Pending¶
- Bug: WhatsApp volume/delivery reports undercount.
- Root cause 📄 (high confidence): delivery receipts are never persisted — messages stall at
process_status=3and the serverlessconsumer-receiptsLambda is stubbed / log-only (debt D8). No monolith receipt processor exists (map-04 §5.11). - Where to look:
prism-services/src/whatsapp/handlers/consumers/receipts.js(stub),processLibrary/whatsappMsgProcess.js(sets status 3),whatsapp_queue_*,monthly_whatsapp_report.js. - Validate: count
process_statusdistribution for a day; comparesentvs provider dashboard; confirm no code path writes delivered/read back. See RB-4.
E1.4 — Various CRM statistics incorrect · P0 · Pending¶
- Bug: assorted dashboard/CRM stats wrong.
- Hypothesis 📄: dual dashboard controllers (debt D4) + stale/lagging MIS aggregation + cross-widget source divergence (A4.4).
- Where to look:
dashboardController.jsvsdashboardControllerNew.js,processLibrary/dashboardMIS.js,aggregationProcess.js,dashboard_mis,daily_summary_*. - Validate: per widget, trace the source query; compare against live
orders/customers; verify MIS freshness against A4.3 SLAs.
E1.5 — Campaign builder budgeting & scheduling issues · P0 · Pending¶
- Bug: budget caps and scheduled sends misbehave.
- Hypothesis 📄: wallet deduction vs budget enforcement happens at send-time in
automatedCampaignQueueNew.js/sendSms.js, not at schedule-time; date-suffixed queues (_YYYYMMDD) make "schedule for tomorrow" fragile; no rate limiting (D18). - Where to look:
automatedCampaignQueueNew.js,processCampaign.js,sendSms.js,sms_queue_*/whatsapp_queue_*execution_time. - Validate: schedule a capped campaign; verify it stops at budget and fires at the right
execution_time; check enqueue-date vs intended date.
E1.6 — Loyalty flow & automation issues · P0 · Pending¶
- Bug: points not credited / automations misfire.
- Hypothesis 📄:
crm_points_allocation_queuerows stuckfailed/retries>=5; non-atomic flow (D2); fraud-rule blocks silently drop allocations. - Where to look:
crmPointsAllocationQueueCron.js,handleWalletPointsFlow.js,fraudRulesController.js,crm_points_allocation_queue. - Validate: trace one order end-to-end (queue insert → cron pickup → wallet write); inspect failed rows and fraud-rule outcomes. See RB-2.
E1.7 — All 8 automated journey logics need verification · P0 · Pending¶
- Bug: journey/automation logic unverified (welcome, birthday, abandon-cart, etc.).
- Hypothesis 📄: legacy vs new queue builders (
automatedCampaignQueue.jsvsNew, debt D3) applied inconsistently across the 8 journeys; overlap/idempotency gaps (D22) cause double or missed sends. - Where to look:
automatedCampaignController.js,processAutomatedCampaigns.js,autoCampaign.js,abandonCartCron.js,campaign_journeys. - Validate: for each of the 8 journey types, trigger a known audience and assert exactly-once send + correct template/variable substitution.
E1.8 — Digital bills report logic · P1 · Pending¶
- Bug: digital-bill reports incorrect.
- Hypothesis 📄: click/download/feedback events aggregate inconsistently between
invoiceInsightsController.jsanddigitalBillController.js. - Where to look:
invoiceInsightsController.js(invoiceClick,invoiceDownload,feedbackClick),digital_bill_mis,digital_bill_customers,dashboard_mis. - Validate: generate known clicks/downloads; reconcile counts against
digital_bill_mis.
E1.9 — AOV shows ₹0 in "Your Effective Offers" · P1 · Pending¶
- Bug: AOV renders ₹0 (should be Revenue / Redemptions).
- Root cause 📄 (high confidence): the effective-offers query divides Revenue by Redemptions; when Redemptions = 0/null (or operands swapped/null) the guard is missing and it falls to 0 instead of an empty-state. PM spec explicitly states AOV = Revenue/Redemptions.
- Where to look: the effective-offers aggregation (offers/rewards analytics in
rewardsController.js/ dashboard offers widget),wallet_transactionsredemption rows. - Validate: find an offer with redemptions > 0; confirm AOV computes non-zero; add a guarded fallback and verify against A4.1. See RB-7.
E1.10 — Loyalty points 2-point discrepancy · P1 · Pending¶
- Bug: Total ≠ Used + Available + Expired (typically off by ~2).
- Root cause 📄 (high confidence): non-atomic points ledger across MongoDB + MySQL (debt D2) — an allocation or expiry writes one store but not the other, or double-counts on retry without idempotency. The 2-point delta is a rounding/duplicate artifact of the split ledger.
- Where to look:
handleWalletPointsFlow.js,crmPointsAllocationQueueCron.js(retry path),loyalty_milestone_downgrade.js(expiry/forfeit),wallet_transactions, MySQL wallet tables. - Validate: reconstruct the ledger for an affected customer from
wallet_transactions; identify the missing/duplicate entry; test with an idempotency flag so retries don't double-write. See RB-2.
E1.11 — Loyalty microsite redemption flow issues · P1 · Pending¶
- Bug: microsite redemption fails/inconsistent.
- Hypothesis 📄: OTP/redemption endpoints (
rewardsController,/integration/v1redeem routes) andappMiddleware/crm_offer_middlewareauth mismatch; redemption not reflected atomically in wallet. - Where to look:
rewardsController.redeemLoyalityRewards/generateOtp,integrationController.redeemLoyaltyPoints, loyalty_rewards routes,appMiddleware.js. - Validate: run the microsite redemption end-to-end; confirm OTP, auth scope, and wallet deduction all commit together.
E1.12 — Layered filters (SKU/promo/audience intelligence) in reports · P2 · Pending¶
- Bug: reports lack layered SKU/promo/audience filtering (feature-gap surfacing as "wrong" numbers when filtered).
- Hypothesis 📄: aggregation collections don't retain SKU/promo dimensions needed for drill-down; segment filters (
getOnlySegmentCount.js,segmentCountV2.js) not joined into report queries. - Where to look:
aggregationProcess.js(top_selling_items, item_revenue, category perf),segmentCountV2.js, report controllers. - Validate: confirm required dimensions exist in aggregates; prototype a layered filter query and reconcile against raw
orders/order_items.
Triage summary¶
| Bug | Priority | Confidence | Primary debt link | Runbook |
|---|---|---|---|---|
| E1.1 ROI | P0 | 📄 med | D5 | — |
| E1.2 Loyalty metrics | P0 | 📄 med | D2 | RB-2 |
| E1.3 WA volume | P0 | ✅ high | D8, D9 | RB-4 |
| E1.4 CRM stats | P0 | 📄 med | D4 | RB-5 |
| E1.5 Campaign builder | P0 | 📄 med | D18 | RB-3 |
| E1.6 Loyalty flow | P0 | 📄 med | D2 | RB-2 |
| E1.7 Journeys | P0 | 📄 med | D3, D22 | RB-6 |
| E1.8 Digital bills | P1 | 📄 low | — | — |
| E1.9 AOV ₹0 | P1 | ✅ high | — | RB-7 |
| E1.10 Points discrepancy | P1 | ✅ high | D2 | RB-2 |
| E1.11 Microsite redeem | P1 | 📄 low | — | — |
| E1.12 Layered filters | P2 | 📄 low | D15 | — |