[rst-commit] r181 - in /redwax-signtext-firefox/trunk: ChangeLog content.js

rst-commit at redwax.eu rst-commit at redwax.eu
Mon Jul 8 15:06:17 CEST 2024


Author: minfrin at redwax.eu
Date: Mon Jul  8 15:06:16 2024
New Revision: 181

Log:
Messages involving disconnection carry no UUID, make sure
we don't reject these messages.

Modified:
    redwax-signtext-firefox/trunk/ChangeLog
    redwax-signtext-firefox/trunk/content.js

Modified: redwax-signtext-firefox/trunk/ChangeLog
==============================================================================
--- redwax-signtext-firefox/trunk/ChangeLog	(original)
+++ redwax-signtext-firefox/trunk/ChangeLog	Mon Jul  8 15:06:16 2024
@@ -1,5 +1,8 @@
 
 Changes with v0.9.5
+
+ *) Messages involving disconnection carry no UUID, make sure
+    we don't reject these messages. [Graham Leggett]
 
  *) Distinguish between the native app having handled at least
     one message and disconnected, and the native app not having

Modified: redwax-signtext-firefox/trunk/content.js
==============================================================================
--- redwax-signtext-firefox/trunk/content.js	(original)
+++ redwax-signtext-firefox/trunk/content.js	Mon Jul  8 15:06:16 2024
@@ -73,15 +73,15 @@
 			);
 
 			const signTextHandler = function(e) {
-				/* message not for us */
-				if ((typeof e.uuid === "undefined") || (e.uuid !== uuid)) {
-					/* do nothing */
-				}
 				/* an error was received, cancel the stream */
-				else if (typeof e.error !== "undefined") {
+				if (typeof e.error !== "undefined") {
 					const error = new window.wrappedJSObject.Error(e.error);
 					stringReject(error);
 					port.onMessage.removeListener(signTextHandler);
+				}
+				/* message not for us */
+				else if ((typeof e.uuid === "undefined") || (e.uuid !== uuid)) {
+					/* do nothing */
 				}
 				/* no response, weird, throw an error back */
 				else if (typeof e.response === "undefined") {



More information about the rst-commit mailing list