From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <d.csapak@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 7484B6274D
 for <pve-devel@lists.proxmox.com>; Fri, 11 Feb 2022 14:57:23 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 6905E2A5FF
 for <pve-devel@lists.proxmox.com>; Fri, 11 Feb 2022 14:57:23 +0100 (CET)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS id 748392A5F4
 for <pve-devel@lists.proxmox.com>; Fri, 11 Feb 2022 14:57:22 +0100 (CET)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 45F2846DF1
 for <pve-devel@lists.proxmox.com>; Fri, 11 Feb 2022 14:57:22 +0100 (CET)
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Date: Fri, 11 Feb 2022 14:57:21 +0100
Message-Id: <20220211135721.2423780-1-d.csapak@proxmox.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.158 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
 T_SCC_BODY_TEXT_LINE    -0.01 -
Subject: [pve-devel] [PATCH novnc] fix #3882: backport firefox workaround
 for ResizeObserver
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Fri, 11 Feb 2022 13:57:23 -0000

it's a minor but annoying issue, and novnc does not release that often,
so backport the patch

also rebases our patches on top

we can drop this with the next novnc release

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 debian/patches/0017-make-error-hideable.patch |  4 +--
 ...ow-start-button-on-not-running-vm-ct.patch | 12 +++----
 .../0001-Ignore-ResizeObserver-errors.patch   | 31 +++++++++++++++++++
 debian/patches/series                         |  1 +
 4 files changed, 40 insertions(+), 8 deletions(-)
 create mode 100644 debian/patches/extra/0001-Ignore-ResizeObserver-errors.patch

diff --git a/debian/patches/0017-make-error-hideable.patch b/debian/patches/0017-make-error-hideable.patch
index 9322ade..df0c484 100644
--- a/debian/patches/0017-make-error-hideable.patch
+++ b/debian/patches/0017-make-error-hideable.patch
@@ -11,7 +11,7 @@ Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
  1 file changed, 15 insertions(+), 2 deletions(-)
 
 diff --git a/app/error-handler.js b/app/error-handler.js
-index 81a6cba..6ce8013 100644
+index f956c22..20233b2 100644
 --- a/app/error-handler.js
 +++ b/app/error-handler.js
 @@ -15,6 +15,18 @@
@@ -33,7 +33,7 @@ index 81a6cba..6ce8013 100644
  
      // Fallback for all uncought errors
      function handleError(event, err) {
-@@ -52,8 +64,9 @@
+@@ -58,8 +70,9 @@
                  msg.appendChild(div);
              }
  
diff --git a/debian/patches/0018-show-start-button-on-not-running-vm-ct.patch b/debian/patches/0018-show-start-button-on-not-running-vm-ct.patch
index d4243ca..8531922 100644
--- a/debian/patches/0018-show-start-button-on-not-running-vm-ct.patch
+++ b/debian/patches/0018-show-start-button-on-not-running-vm-ct.patch
@@ -13,9 +13,9 @@ colors were adapted
 
 Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 ---
- app/pve.js          | 34 ++++++++++++++++++++++++--
- app/styles/pve.css  | 58 +++++++++++++++++++++++++++++++++++++++++++++
- vnc.html            |  9 +++++++
+ app/pve.js         | 34 +++++++++++++++++++++++++--
+ app/styles/pve.css | 58 ++++++++++++++++++++++++++++++++++++++++++++++
+ vnc.html           |  9 +++++++
  3 files changed, 99 insertions(+), 2 deletions(-)
 
 diff --git a/app/pve.js b/app/pve.js
@@ -78,7 +78,7 @@ index 042eb7c..9da23ed 100644
  	var me = this;
  	try {
 diff --git a/app/styles/pve.css b/app/styles/pve.css
-index 18126b0..f2e7484 100644
+index 18126b0..e0ca61f 100644
 --- a/app/styles/pve.css
 +++ b/app/styles/pve.css
 @@ -44,3 +44,61 @@
@@ -144,10 +144,10 @@ index 18126b0..f2e7484 100644
 +  padding: 0 5px 2px 0;
 +}
 diff --git a/vnc.html b/vnc.html
-index d94fd99..72efa89 100644
+index 3e63087..f0488b1 100644
 --- a/vnc.html
 +++ b/vnc.html
-@@ -283,6 +283,15 @@
+@@ -281,6 +281,15 @@
          </div>
      </div>
  
diff --git a/debian/patches/extra/0001-Ignore-ResizeObserver-errors.patch b/debian/patches/extra/0001-Ignore-ResizeObserver-errors.patch
new file mode 100644
index 0000000..af33fc6
--- /dev/null
+++ b/debian/patches/extra/0001-Ignore-ResizeObserver-errors.patch
@@ -0,0 +1,31 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Pierre Ossman <ossman@cendio.se>
+Date: Mon, 22 Nov 2021 13:53:05 +0100
+Subject: [PATCH] Ignore ResizeObserver errors
+
+It seems that Firefox has a bug where these are fired incorrectly when
+we are in an <iframe>. The events also contain no useful details, so we
+can't really do anything useful with them anyway.
+
+Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
+---
+ app/error-handler.js | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/app/error-handler.js b/app/error-handler.js
+index 81a6cba..f956c22 100644
+--- a/app/error-handler.js
++++ b/app/error-handler.js
+@@ -21,6 +21,12 @@
+         try {
+             const msg = document.getElementById('noVNC_fallback_errormsg');
+ 
++            // Work around Firefox bug:
++            // https://bugzilla.mozilla.org/show_bug.cgi?id=1685038
++            if (event.message === "ResizeObserver loop completed with undelivered notifications.") {
++                return false;
++            }
++
+             // Only show the initial error
+             if (msg.hasChildNodes()) {
+                 return false;
diff --git a/debian/patches/series b/debian/patches/series
index 085e2b4..ef9e9df 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
+extra/0001-Ignore-ResizeObserver-errors.patch
 0001-add-PVE-specific-JS-code.patch
 0002-add-custom-fbresize-event-on-rfb.patch
 0003-change-scaling-when-toggling-fullscreen.patch
-- 
2.30.2