سامانه صدور فاکتور و حسابداری
fix: prevent delayed generic sync racing source autopost RPC
davoodmehraban89 committed
Nov 17, 2026 at 13:58 UTC
15703b4a98dd1ffdafe0f70bcfb120249e8d6047
1 file changed
+3
js/journal-rpc.js
+3
@@ -177,6 +177,9 @@ async function jeRpcPersistSourceRecord(collection,id){
177
if(typeof saveDatastore!=='function'||typeof runSync!=='function'||typeof syncSnap==='undefined')
178
throw new Error('لایه همگامسازی برای تأیید ثبت منبع در دسترس نیست.');
179
saveDatastore();
180
+ // saveDatastore schedules a delayed retry; cancel it because this adapter
181
+ // owns the immediate flush and must not race its following journal RPC.
182
+ if(typeof syncTimer!=='undefined'&&syncTimer!==null){clearTimeout(syncTimer);syncTimer=null;}
183
await runSync();
184
const deadline=Date.now()+20000;
185
while(Date.now()<deadline){