channel-worker 2.5.74 → 2.5.75

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "channel-worker",
3
- "version": "2.5.74",
3
+ "version": "2.5.75",
4
4
  "description": "Channel Manager worker daemon — runs on remote machines to execute video pipeline jobs",
5
5
  "main": "lib/daemon.js",
6
6
  "bin": {
@@ -1686,7 +1686,6 @@ async function runOnce({ page, payload, log }) {
1686
1686
  const closeDeadline = Date.now() + 60_000;
1687
1687
  let modalClosed = false;
1688
1688
  let closedPolls = 0;
1689
- let appliedPolls = 0;
1690
1689
  let retryCount = 0;
1691
1690
  const RETRY_AFTER_MS = 12_000;
1692
1691
  let lastRetryAt = Date.now();
@@ -1696,23 +1695,21 @@ async function runOnce({ page, payload, log }) {
1696
1695
  // nested form (no own dialog — its upload button, aria
1697
1696
  // "Tải hình thu nhỏ tùy chỉnh lên…", only exists while the
1698
1697
  // editor is showing).
1699
- // Biến thể inline: panel không bao giờ đóng nhưng nút "Gỡ hình
1700
- // thu nhỏ tùy chỉnh" đã hiện = thumb ĐÃ áp. Chỉ tin ở nhánh
1701
- // nested (modal thật vẫn phải đóng sau Lưu như cũ) đòi 2
1702
- // mẫu liên tiếp như luật closedPolls; bấm Lưu chốt một nhịp
1703
- // cuối phòng cohort nào đó vẫn cần Lưu để giữ trạng thái.
1704
- if (thumbEditorVia === 'nested' && await isCustomThumbApplied(page)) {
1705
- if (++appliedPolls >= 2) {
1706
- for (const sel of saveCandidates) {
1707
- const btn = await firstVisible(page.locator(sel), 1);
1708
- if (btn) { await btn.click({ timeout: 1500 }).catch(() => {}); break; }
1709
- }
1710
- log('info', '[fb-pw] page-wall thumb — panel inline không đóng nhưng nút "Gỡ hình thu nhỏ" đang hiện → coi như dán xong');
1711
- modalClosed = true; break;
1712
- }
1713
- } else {
1714
- appliedPolls = 0;
1715
- }
1698
+ // ĐÃ GỠ (2.5.75) lối tắt "thấy nút Gỡ 2 nhịp thì coi như xong,
1699
+ // bấm Lưu chốt một cái rồi đi tiếp". Đo trên 20.000 dòng log
1700
+ // ngày 04/09/2026: lối tắt chạy 21 lượt thì 19 lượt kết thúc
1701
+ // bằng dump "composer closed after saving thumbnail", trong khi
1702
+ // đường thường (chờ editor đóng hẳn) chạy 98 lượt đăng ngon.
1703
+ // Chuỗi log lặp đúng một khuôn: NORMAL→PUBLISH, FAST→DUMP DUMP.
1704
+ //
1705
+ // Nút "Gỡ" hiện NGAY khi file vừa dán, lúc ảnh còn đang xử lý
1706
+ // (ảnh dump nào cũng thấy spinner), nên lối tắt cướp lượt của
1707
+ // những lần lẽ ra đóng bình thường sau 3-5s, rồi bấm Lưu lần
1708
+ // hai khi FB đang lưu dở — composer bị gỡ khỏi trang.
1709
+ //
1710
+ // Cohort inline thật (panel không bao giờ đóng) vẫn còn hai lớp
1711
+ // cứu phía dưới: nhánh hết-giờ-60s và cổng trước Đăng, cả hai
1712
+ // đều KHÔNG bấm thêm Lưu. Đó mới là đường đã nghiệm thu 03/09.
1716
1713
  const still = await isThumbnailEditorVisible(page);
1717
1714
  if (!still) {
1718
1715
  // Require two consecutive closed samples. Facebook briefly
@@ -1726,7 +1723,8 @@ async function runOnce({ page, payload, log }) {
1726
1723
  // Retry Lưu click after RETRY_AFTER_MS without progress —
1727
1724
  // limit to 3 retries (so we still leave time for FB to
1728
1725
  // finish processing on the last attempt).
1729
- if (retryCount < 3 && Date.now() - lastRetryAt >= RETRY_AFTER_MS) {
1726
+ if (retryCount < 3 && Date.now() - lastRetryAt >= RETRY_AFTER_MS
1727
+ && !(await isCustomThumbApplied(page))) {
1730
1728
  retryCount++;
1731
1729
  lastRetryAt = Date.now();
1732
1730
  log('info', `[fb-pw] thumb modal still open after ${retryCount * (RETRY_AFTER_MS / 1000)}s — re-clicking Lưu (retry ${retryCount}/3)`);