@lightcone-ai/daemon 0.15.3 → 0.15.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -385,6 +385,7 @@ export class DouyinAdapter {
385
385
  const startedAt = Date.now();
386
386
  let sawProgress = expectedCount === 0;
387
387
  let stableReadyRounds = 0;
388
+ let forcedReadyRounds = 0;
388
389
  let pollCount = 0;
389
390
  let lastHint = 'no_state';
390
391
 
@@ -405,22 +406,34 @@ export class DouyinAdapter {
405
406
  const draftReady = composer.draftButtonExists && composer.draftButtonDisabled !== true;
406
407
  const uploadedHint = /上传成功|重新上传|更换|替换|已上传|继续编辑|移除/.test(text);
407
408
  const completionSignal = sawProgress || uploadedHint || composer.mediaActionVisible;
409
+ const readyForEditing = editorReady && draftReady && completionSignal;
408
410
 
409
411
  lastHint = this._formatUploadWaitHint(state, composer, {
410
412
  processing,
411
413
  sawProgress,
412
414
  completionSignal,
413
415
  stableReadyRounds,
416
+ forcedReadyRounds,
414
417
  });
415
418
 
416
- if (!processing && editorReady && draftReady && completionSignal) {
419
+ if (!processing && readyForEditing) {
420
+ forcedReadyRounds = 0;
417
421
  stableReadyRounds += 1;
418
422
  if (stableReadyRounds >= 2) return;
419
423
  } else if (!processing && editorReady && draftReady && (Date.now() - startedAt) >= 25_000) {
424
+ forcedReadyRounds = 0;
420
425
  stableReadyRounds += 1;
421
426
  if (stableReadyRounds >= 4) return;
427
+ } else if (processing && readyForEditing) {
428
+ stableReadyRounds = 0;
429
+ forcedReadyRounds += 1;
430
+ if (forcedReadyRounds >= 3) {
431
+ console.error(`[DouyinAdapter] wait-upload force-ready after persistent processing poll=${pollCount} ${lastHint}`);
432
+ return;
433
+ }
422
434
  } else {
423
435
  stableReadyRounds = 0;
436
+ forcedReadyRounds = 0;
424
437
  }
425
438
 
426
439
  if (pollCount % 10 === 0) {
@@ -529,6 +542,7 @@ export class DouyinAdapter {
529
542
  `draftButton=${composer.draftButtonExists === true}`,
530
543
  `draftDisabled=${composer.draftButtonDisabled === true}`,
531
544
  `stableReadyRounds=${flags.stableReadyRounds ?? 0}`,
545
+ `forcedReadyRounds=${flags.forcedReadyRounds ?? 0}`,
532
546
  `errors=${errors.slice(0, 180)}`,
533
547
  ].join('; ');
534
548
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightcone-ai/daemon",
3
- "version": "0.15.3",
3
+ "version": "0.15.4",
4
4
  "type": "module",
5
5
  "main": "src/index.js",
6
6
  "bin": {