From 13aa5a4e2581e9f74c892c38dbf330fa0d6b7cc4 Mon Sep 17 00:00:00 2001 From: orel Date: Fri, 5 Feb 2021 16:58:55 +0100 Subject: [PATCH 1/7] Enhance jsclient-socket documentation --- docs/jsclientlib/socket.rst | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/docs/jsclientlib/socket.rst b/docs/jsclientlib/socket.rst index 925528490..7bffa2f54 100644 --- a/docs/jsclientlib/socket.rst +++ b/docs/jsclientlib/socket.rst @@ -64,12 +64,24 @@ Sends a message of type ``type`` with the provided ``payload`` to the server. - Note that at the time of writing, OctoPrint only supports the ``throttle`` message. See + Note that at the time of writing, OctoPrint only supports the ``throttle`` and ``auth`` messages. See also the :ref:`Push API documentation `. :param string type: Type of message to send :param object payload: Payload to send +.. js:function:: OctoPrintClient.socket.sendAuth(userId, session) + + Sends an ``auth`` message with the provided ``userId`` and ``session`` to the server. + + ``session`` is expected to be the ``session`` value retrieved + from any valid :ref:`OctoPrint.browser.login(userId,...) ` response. + + See also the :ref:`Push API documentation `. + + :param string userId: An existing OctoPrint username + :param string session: A valid session id for the provided username + .. js:function:: OctoPrintClient.socket.onRateTooLow(measured, minimum) Called by the socket client when the measured message round trip times have been lower than @@ -102,6 +114,17 @@ Instructs the server to decrease the message rate by 500ms. +Sample to setup an authed socket +================================ + +.. code-block:: javascript + + OctoPrint.socket.connect(); + OctoPrint.browser.login("myusername", "mypassword", true) + .done(function(response) { + client.socket.sendAuth("myusername", response.session); + }); + .. _sec-jsclient-socket-throttling: Communication Throttling From eddc288d9eb9ec9056d1e8f6f65dd9e8034b2dcc Mon Sep 17 00:00:00 2001 From: orel Date: Fri, 5 Feb 2021 17:05:04 +0100 Subject: [PATCH 2/7] Fix typo as there is no instanciated client in the sample... --- docs/jsclientlib/socket.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/jsclientlib/socket.rst b/docs/jsclientlib/socket.rst index 7bffa2f54..70b9bc5dc 100644 --- a/docs/jsclientlib/socket.rst +++ b/docs/jsclientlib/socket.rst @@ -122,7 +122,7 @@ Sample to setup an authed socket OctoPrint.socket.connect(); OctoPrint.browser.login("myusername", "mypassword", true) .done(function(response) { - client.socket.sendAuth("myusername", response.session); + OctoPrint.socket.sendAuth("myusername", response.session); }); .. _sec-jsclient-socket-throttling: From 641a4cdb0051dc82815720127f6589ecf9d9f8e5 Mon Sep 17 00:00:00 2001 From: Orel Date: Fri, 5 Feb 2021 20:46:00 +0100 Subject: [PATCH 3/7] sockJS include when playing with jsclient lib --- docs/jsclientlib/index.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/jsclientlib/index.rst b/docs/jsclientlib/index.rst index 43b734769..4d22e8876 100644 --- a/docs/jsclientlib/index.rst +++ b/docs/jsclientlib/index.rst @@ -40,6 +40,12 @@ because the library depends on those to be available (as ``$`` and ``_``). You c +Moreover, if you need to use the socket module, you'll need to include sockJS. You can embedded it like this: + +.. code-block:: html+jinja + + + Note that all components depend on the ``base`` component to be present, so if you are only including a select number of components, make sure to at the very least include that one to be able to utilize the client. From 9792e1e3ae91d1547470f54336b46bd063afcea2 Mon Sep 17 00:00:00 2001 From: Orel Date: Fri, 5 Feb 2021 20:51:33 +0100 Subject: [PATCH 4/7] Fix my bad english... --- docs/jsclientlib/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/jsclientlib/index.rst b/docs/jsclientlib/index.rst index 4d22e8876..280b3c241 100644 --- a/docs/jsclientlib/index.rst +++ b/docs/jsclientlib/index.rst @@ -40,7 +40,7 @@ because the library depends on those to be available (as ``$`` and ``_``). You c -Moreover, if you need to use the socket module, you'll need to include sockJS. You can embedded it like this: +Moreover, if you need to use the socket module, you'll need to include sockJS. You can embed it like this: .. code-block:: html+jinja From 5eb03c1e9ec62cd7911780919d5bbe7192324fa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 9 Feb 2021 14:43:31 +0100 Subject: [PATCH 5/7] =?UTF-8?q?=F0=9F=9A=B8=20Request=20unzipped=20log=20f?= =?UTF-8?q?iles=20in=20bug=20reports?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/bug_report.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 6e56ba502..5127633d4 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -92,10 +92,10 @@ inputs: value: >- Please also be sure to upload the following files below: - * `octoprint.log`: See [here](https://community.octoprint.org/t/where-can-i-find-octoprints-and-octopis-log-files/299) if you don't know where to find that. + * `octoprint.log`: See [here](https://community.octoprint.org/t/where-can-i-find-octoprints-and-octopis-log-files/299) if you don't know where to find that. Please do not zip, modify or paste, just attach down below as-is. * `serial.log` or the contents of your terminal tab, if applicable. Always include if unsure. **Please note that you need to enable `serial.log` first**, - see [here](https://community.octoprint.org/t/where-can-i-find-octoprints-and-octopis-log-files/299) if you don't know how to do or where to find it. + see [here](https://community.octoprint.org/t/where-can-i-find-octoprints-and-octopis-log-files/299) if you don't know how to do or where to find it. Please do not zip, modify or paste, just attach down below as-is. * Your browser's JavaScript console, if you are reporting a problem with the user interface. See [here](https://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers) on where to find that. * If possible, screenshots or videos showing the problem, especially if you @@ -109,7 +109,7 @@ inputs: attributes: label: Checklist of files to include below choices: - - label: octoprint.log + - label: octoprint.log (unmodified, unzipped, just attached below) required: true - label: serial.log or contents of your terminal tab (always include in cases of issues with printer communication) - label: Contents of the JavaScript browser console (always include in cases of issues with the user interface) From 5257a2c863ee002dca0099f6c8fdc0bc5ef1b2b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 9 Feb 2021 15:11:19 +0100 Subject: [PATCH 6/7] =?UTF-8?q?=F0=9F=9A=B8=20Made=20bundleviewer=20compat?= =?UTF-8?q?ible=20to=20zipped=20logs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/bug_report.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 5127633d4..84d1592e0 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -92,10 +92,10 @@ inputs: value: >- Please also be sure to upload the following files below: - * `octoprint.log`: See [here](https://community.octoprint.org/t/where-can-i-find-octoprints-and-octopis-log-files/299) if you don't know where to find that. Please do not zip, modify or paste, just attach down below as-is. + * `octoprint.log`: See [here](https://community.octoprint.org/t/where-can-i-find-octoprints-and-octopis-log-files/299) if you don't know where to find that. Just attach down below as-is. * `serial.log` or the contents of your terminal tab, if applicable. Always include if unsure. **Please note that you need to enable `serial.log` first**, - see [here](https://community.octoprint.org/t/where-can-i-find-octoprints-and-octopis-log-files/299) if you don't know how to do or where to find it. Please do not zip, modify or paste, just attach down below as-is. + see [here](https://community.octoprint.org/t/where-can-i-find-octoprints-and-octopis-log-files/299) if you don't know how to do or where to find it. Just attach down below as-is. * Your browser's JavaScript console, if you are reporting a problem with the user interface. See [here](https://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers) on where to find that. * If possible, screenshots or videos showing the problem, especially if you @@ -109,7 +109,7 @@ inputs: attributes: label: Checklist of files to include below choices: - - label: octoprint.log (unmodified, unzipped, just attached below) + - label: octoprint.log required: true - label: serial.log or contents of your terminal tab (always include in cases of issues with printer communication) - label: Contents of the JavaScript browser console (always include in cases of issues with the user interface) From f50f7ab4f5826683dc2daec22e879e8f12f6e81f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 9 Feb 2021 15:47:07 +0100 Subject: [PATCH 7/7] =?UTF-8?q?=F0=9F=9A=B8=20Additional=20field=20for=20"?= =?UTF-8?q?safe=20mode=20untested"=20explanation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/bug_report.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 84d1592e0..e0816d0f9 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -58,6 +58,17 @@ inputs: - No, it did not persist (it's an issue with one of your installed plugins, don't report here) - I cannot test this issue in safe mode (state why below) required: true + - type: input + attributes: + label: If you could not test in safe mode, please state why + description: >- + Issues caused by a third party plugin are a major cause of bugs reported here, so we really need to + rule out that a plugin is at fault here. [Safe mode](https://docs.octoprint.org/en/master/features/safemode.html) is an easy way to do that. Only skip safe mode + if your particular problem *absolutely requires* third party plugins to be enabled. "It would take + too long" is **not** a reason to skip testing in safe mode, neither is "I do not know how to + enable it" as you can find info on that [here](https://docs.octoprint.org/en/master/features/safemode.html). + + If you really *cannot* test in safe mode, leave a short explanation as to why. - type: description attributes: value: |