validate delivery review metadata

This commit is contained in:
2026-09-06 17:26:35 +03:00
parent 6a061e5800
commit 615d8fe69d
+1 -1
View File
@@ -13,7 +13,7 @@ function Queue({weekly}){
const load=async()=>{ const load=async()=>{
const data=await accountRequest(endpoint); const data=await accountRequest(endpoint);
const received=requireArray(data,'deliveries'); const received=requireArray(data,'deliveries');
const rows=received.filter(row=>row && typeof row==='object' && typeof row.id==='string' && row.id.trim() && typeof row.state==='string' && (row.subject == null || typeof row.subject==='string') && (row.to == null || ['string','number'].includes(typeof row.to)) && (row.error == null || typeof row.error==='string')); const rows=received.filter(row=>row && typeof row==='object' && typeof row.id==='string' && row.id.trim() && typeof row.state==='string' && (row.subject == null || typeof row.subject==='string') && (row.to == null || ['string','number'].includes(typeof row.to)) && (row.error == null || typeof row.error==='string') && (row.providerId == null || typeof row.providerId==='string') && (row.review == null || (typeof row.review==='object' && typeof row.review.actor==='string' && typeof row.review.note==='string' && Number.isFinite(Date.parse(row.review.at)))));
if(rows.length!==received.length)throw new Error('Sunucu gönderim kayıtlarından birini geçersiz döndürdü. Liste yenilenemedi.'); if(rows.length!==received.length)throw new Error('Sunucu gönderim kayıtlarından birini geçersiz döndürdü. Liste yenilenemedi.');
if(alive.current)setRows(rows); if(alive.current)setRows(rows);
}; };