diff --git a/src/modules/order-rules/dispatcher.cjs b/src/modules/order-rules/dispatcher.cjs index fc8c001..757a0ca 100644 --- a/src/modules/order-rules/dispatcher.cjs +++ b/src/modules/order-rules/dispatcher.cjs @@ -65,7 +65,7 @@ class OrderRuleDispatcher{ const legacyStart=new Date(Date.parse(batch.cutoff)+8*3600000).toISOString().slice(0,10)+'T00:00:00+08:00'; if(!batch.window||batch.window.end!==expected.end||![Date.parse(expected.start),Date.parse(legacyStart)].includes(Date.parse(batch.window.start))||batch.window.startInclusive!==true||batch.window.endInclusive!==false)continue; const grace=batch.intakeGrace?.cutoff===batch.cutoff&&Date.parse(batch.intakeGrace.expiresAt)===Date.parse(batch.cutoff)+1800000&&Date.parse(batch.createdAt)<=Date.parse(batch.intakeGrace.expiresAt)&&batch.orderIds?.every(id=>{const order=this.store.get('orders',id);return order&&(this.store.intakeWindow(order.sample||order.event)?.end===batch.cutoff||require('./carry-forward.cjs').windowForOrder(this.store,order,modeOf(batch))?.end===batch.cutoff);}); - if(batch.createdAt&&(Date.parse(batch.createdAt)>Date.parse(batch.cutoff)+60000&&!grace||Date.parse(batch.createdAt)Date.parse(batch.cutoff)+60000+prepareSkewMs&&!grace||Date.parse(batch.createdAt)60000)this.schedule={signature,next:nextSlots(schedule,this.clock(),1,calendar)[0]};