guacamole-common-js BlobWriter.js Bug

2019-06-24 Thread James Caple
Hi,

Thanks for the guacamole project.  I've been using it with good success on
a project at work.  I've been developing a Javascript Client to integrate
with MS Windows Virtual Machines.  I used the Javascript API to develop
some file transfer capabilities.  I was unable to get the BlobWriter JS
file to work as currently available here (
https://github.com/apache/guacamole-client/tree/master/guacamole-common-js/src/main/webapp/modules).
I kept getting the following error whenever I'd try to write files to the
VM:

zone.js:1495 Uncaught (in promise) DOMException: Failed to execute
'readAsArrayBuffer' on 'FileReader': The object is already busy reading
Blobs.
at _global.. [as readAsArrayBuffer] (
https://redacted/polyfills.6e39da16eddfecb84434.js:3830:60)
at readNextChunk (
https://redacted/main.51a4f7c78afe09ae8d5e.js:168269:20)
at
push../src/app/components/core/desktop/js/BlobWriter.js.redacted.ArrayBufferWriter.sendMoreChunks
[as onack] (https://redacted/main.51a4f7c78afe09ae8d5e.js:168295:17)
at
push../node_modules/guacamole-common-js/dist/guacamole-common.js.Guacamole.OutputStream.stream.onack
(https://redacted/main.51a4f7c78afe09ae8d5e.js:168396:25)
at ack (https://redacted/main.51a4f7c78afe09ae8d5e.js:114024:28)
at
push../node_modules/guacamole-common-js/dist/guacamole-common.js.Guacamole.HTTPTunnel.tunnel.oninstruction
(https://redacted/main.51a4f7c78afe09ae8d5e.js:114685:13)
at XMLHttpRequest.parseResponse [as
__zone_symbol__ON_PROPERTYreadystatechange] (
https://redacted/main.51a4f7c78afe09ae8d5e.js:123910:40)
at XMLHttpRequest.wrapFn (
https://redacted/polyfills.6e39da16eddfecb84434.js:3667:39)
at
ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask
(https://redacted/polyfills.6e39da16eddfecb84434.js:2758:31)
at Object.onInvokeTask (
https://redacted/main.51a4f7c78afe09ae8d5e.js:33312:33)

I came up with an easy workaround to this issue, and thought someone might
be interested.  My amended BlobWriter.js is attached.

Thanks,

James Caple


[GitHub] [guacamole-client] mike-jumper merged pull request #419: GUACAMOLE-302: Incorrect password field focus

2019-06-24 Thread GitBox
mike-jumper merged pull request #419: GUACAMOLE-302: Incorrect password field 
focus
URL: https://github.com/apache/guacamole-client/pull/419
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [guacamole-client] mike-jumper commented on a change in pull request #419: GUACAMOLE-302: Incorrect password field focus

2019-06-24 Thread GitBox
mike-jumper commented on a change in pull request #419: GUACAMOLE-302: 
Incorrect password field focus
URL: https://github.com/apache/guacamole-client/pull/419#discussion_r296925653
 
 

 ##
 File path: guacamole/src/main/webapp/app/login/directives/login.js
 ##
 @@ -188,17 +197,37 @@ angular.module('login').directive('guacLogin', [function 
guacLogin() {
 
 // Clear all remaining fields that are not username fields
 angular.forEach($scope.remainingFields, function 
clearEnteredValueIfPassword(field) {
-
+
 // If field is not username field, delete it.
 if (field.type !== Field.Type.USERNAME && field.name 
in $scope.enteredValues)
 delete $scope.enteredValues[field.name];
-
+
 });
+
 
 Review comment:
   > Unneeded whitespaces removed
   
   It's partly fixed, yes, but the two instances of added whitespace above 
(lines 204 and 206) are still here.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [guacamole-client] m-khan-glyptodon commented on issue #419: GUACAMOLE-302: Incorrect password field focus

2019-06-24 Thread GitBox
m-khan-glyptodon commented on issue #419: GUACAMOLE-302: Incorrect password 
field focus
URL: https://github.com/apache/guacamole-client/pull/419#issuecomment-505185418
 
 
   Update: Unneeded whitespaces removed as well the extra `guac-focus`. Also 
the documentation is altered as per your suggestion. Ready for review.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [guacamole-client] m-khan-glyptodon commented on a change in pull request #419: GUACAMOLE-302: Incorrect password field focus

2019-06-24 Thread GitBox
m-khan-glyptodon commented on a change in pull request #419: GUACAMOLE-302: 
Incorrect password field focus
URL: https://github.com/apache/guacamole-client/pull/419#discussion_r296908797
 
 

 ##
 File path: guacamole/src/main/webapp/app/form/templates/timeZoneField.html
 ##
 @@ -3,12 +3,14 @@
 
 
 
 
 

[GitHub] [guacamole-client] m-khan-glyptodon commented on a change in pull request #419: GUACAMOLE-302: Incorrect password field focus

2019-06-24 Thread GitBox
m-khan-glyptodon commented on a change in pull request #419: GUACAMOLE-302: 
Incorrect password field focus
URL: https://github.com/apache/guacamole-client/pull/419#discussion_r296903205
 
 

 ##
 File path: guacamole/src/main/webapp/app/form/templates/timeZoneField.html
 ##
 @@ -3,12 +3,14 @@
 
 
 
 
 

[GitHub] [guacamole-client] mike-jumper commented on a change in pull request #419: GUACAMOLE-302: Incorrect password field focus

2019-06-24 Thread GitBox
mike-jumper commented on a change in pull request #419: GUACAMOLE-302: 
Incorrect password field focus
URL: https://github.com/apache/guacamole-client/pull/419#discussion_r296881451
 
 

 ##
 File path: guacamole/src/main/webapp/app/form/templates/timeZoneField.html
 ##
 @@ -3,12 +3,14 @@
 
 
 
 
 ` fields doesn't make sense, 
as you can only have one field focused at a time. What is the intended effect?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [guacamole-client] mike-jumper commented on a change in pull request #419: GUACAMOLE-302: Incorrect password field focus

2019-06-24 Thread GitBox
mike-jumper commented on a change in pull request #419: GUACAMOLE-302: 
Incorrect password field focus
URL: https://github.com/apache/guacamole-client/pull/419#discussion_r296883020
 
 

 ##
 File path: guacamole/src/main/webapp/app/login/directives/login.js
 ##
 @@ -188,17 +197,37 @@ angular.module('login').directive('guacLogin', [function 
guacLogin() {
 
 // Clear all remaining fields that are not username fields
 angular.forEach($scope.remainingFields, function 
clearEnteredValueIfPassword(field) {
-
+
 // If field is not username field, delete it.
 if (field.type !== Field.Type.USERNAME && field.name 
in $scope.enteredValues)
 delete $scope.enteredValues[field.name];
-
+
 });
+
 }
 
 }));
 
 };
+
+/**
+ * Returns the field most relevant to the user given the current state
+ * of the login process. This will normally be the first empty field.
+ *
+ * @return {Field}
+ * A field most relevant, null if no relevant field exist.
 
 Review comment:
   > A field most relevant
   
   Do you mean "the field most relevant?"
   
   > null if no relevant field exist.
   
   Is this the case? My reading of the logic is that it will return null if all 
fields appear equally relevant (ie: there is no single "most relevant" field), 
not necessarily that are absolutely no relevant fields whatsoever. In fact, for 
the login process, it's more likely that all fields are relevant; it's a 
question of degrees.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [guacamole-client] m-khan-glyptodon commented on issue #419: GUACAMOLE-302: Incorrect password field focus

2019-06-24 Thread GitBox
m-khan-glyptodon commented on issue #419: GUACAMOLE-302: Incorrect password 
field focus
URL: https://github.com/apache/guacamole-client/pull/419#issuecomment-505148205
 
 
   Update: Changes ready for review.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [guacamole-client] mike-jumper commented on a change in pull request #419: GUACAMOLE-302: Incorrect password field focus

2019-06-24 Thread GitBox
mike-jumper commented on a change in pull request #419: GUACAMOLE-302: 
Incorrect password field focus
URL: https://github.com/apache/guacamole-client/pull/419#discussion_r296870679
 
 

 ##
 File path: guacamole/src/main/webapp/app/login/directives/login.js
 ##
 @@ -188,17 +197,38 @@ angular.module('login').directive('guacLogin', [function 
guacLogin() {
 
 // Clear all remaining fields that are not username fields
 angular.forEach($scope.remainingFields, function 
clearEnteredValueIfPassword(field) {
-
+
 // If field is not username field, delete it.
 if (field.type !== Field.Type.USERNAME && field.name 
in $scope.enteredValues)
 delete $scope.enteredValues[field.name];
-
+
 });
+
 }
 
 }));
 
 };
+
+/**
+ * Returns the field most relevant to the user given the current state
+ * of the login process. This will normally be the first empty field.
+ *
+ * @return {Field}
+ * A field object if an incorrect ligin is attempted, null if no
 
 Review comment:
   "ligin"
   
   Typo aside, what does this function have to do with incorrect login? This 
function looks only at the current state of the login process - what values 
have been entered, what values remain, etc. It isn't aware of whether login was 
incorrect.
   
   I'd also like to point out that "a field object" doesn't provide much more 
information beyond what is already given by `@return {Field}`. The 
documentation for the function itself covers this, but the documentation for 
the return value should also.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [guacamole-client] m-khan-glyptodon commented on issue #419: GUACAMOLE-302: Incorrect password field focus

2019-06-24 Thread GitBox
m-khan-glyptodon commented on issue #419: GUACAMOLE-302: Incorrect password 
field focus
URL: https://github.com/apache/guacamole-client/pull/419#issuecomment-505132145
 
 
   Update: Fixed the default value of $scope.relevantField = {}; as well as the 
documentation.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [guacamole-client] mike-jumper commented on a change in pull request #419: GUACAMOLE-302: Incorrect password field focus

2019-06-24 Thread GitBox
mike-jumper commented on a change in pull request #419: GUACAMOLE-302: 
Incorrect password field focus
URL: https://github.com/apache/guacamole-client/pull/419#discussion_r296850423
 
 

 ##
 File path: guacamole/src/main/webapp/app/login/directives/login.js
 ##
 @@ -102,6 +102,13 @@ angular.module('login').directive('guacLogin', [function 
guacLogin() {
  */
 $scope.submitted = false;
 
+/**
+ * The field that needs to be focused
+ *
+ * @type Field
+ */
+$scope.relevantField = {};
 
 Review comment:
   `{}` is not a `Field` and will also fail simple tests for whether the value 
has been set (`{}` is truthy). If you're looking for a default value prior to 
actual assignment later, `null` would be a better choice.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [guacamole-client] mike-jumper commented on a change in pull request #419: GUACAMOLE-302: Incorrect password field focus

2019-06-24 Thread GitBox
mike-jumper commented on a change in pull request #419: GUACAMOLE-302: 
Incorrect password field focus
URL: https://github.com/apache/guacamole-client/pull/419#discussion_r296853657
 
 

 ##
 File path: guacamole/src/main/webapp/app/login/directives/login.js
 ##
 @@ -188,17 +190,36 @@ angular.module('login').directive('guacLogin', [function 
guacLogin() {
 
 // Clear all remaining fields that are not username fields
 angular.forEach($scope.remainingFields, function 
clearEnteredValueIfPassword(field) {
-
+
 // If field is not username field, delete it.
 if (field.type !== Field.Type.USERNAME && field.name 
in $scope.enteredValues)
 delete $scope.enteredValues[field.name];
-
+
 });
+
 }
 
 }));
 
 };
+
+/**
+ * Returns the field most relevant to the user given the current state
+ * of the login process. This will normally be the first empty field.
+ *
+ * @return {Field}
+ */
 
 Review comment:
   > Update: Added the two pieces of documentation requested above.
   
   I see the new documentation for `$scope.relevantField`, but this return 
value still appears undocumented.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [guacamole-client] mike-jumper commented on a change in pull request #419: GUACAMOLE-302: Incorrect password field focus

2019-06-24 Thread GitBox
mike-jumper commented on a change in pull request #419: GUACAMOLE-302: 
Incorrect password field focus
URL: https://github.com/apache/guacamole-client/pull/419#discussion_r296824715
 
 

 ##
 File path: guacamole/src/main/webapp/app/login/directives/login.js
 ##
 @@ -137,13 +137,15 @@ angular.module('login').directive('guacLogin', [function 
guacLogin() {
 $scope.remainingFields = fields.filter(function isRemaining(field) 
{
 return !(field.name in $scope.values);
 });
-
+
 // Set default values for all unset fields
 angular.forEach($scope.remainingFields, function setDefault(field) 
{
 if (!$scope.enteredValues[field.name])
 $scope.enteredValues[field.name] = '';
 });
 
+$scope.relevantField = getRelevantField();
 
 Review comment:
   Properties which will be set on the scope need to be documented, just as 
functions, objects, etc. This is done through assigning an initial value to the 
property earlier in the directive/controller and using that assignment as the 
location for the property's JSDoc:
   
   For example:
   
   
https://github.com/apache/guacamole-client/blob/829aac98c7c6b04140d97c17be7347039a93ef11/guacamole/src/main/webapp/app/login/directives/login.js#L74-L93
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [guacamole-client] mike-jumper commented on a change in pull request #419: GUACAMOLE-302: Incorrect password field focus

2019-06-24 Thread GitBox
mike-jumper commented on a change in pull request #419: GUACAMOLE-302: 
Incorrect password field focus
URL: https://github.com/apache/guacamole-client/pull/419#discussion_r296824130
 
 

 ##
 File path: guacamole/src/main/webapp/app/login/directives/login.js
 ##
 @@ -188,17 +190,36 @@ angular.module('login').directive('guacLogin', [function 
guacLogin() {
 
 // Clear all remaining fields that are not username fields
 angular.forEach($scope.remainingFields, function 
clearEnteredValueIfPassword(field) {
-
+
 // If field is not username field, delete it.
 if (field.type !== Field.Type.USERNAME && field.name 
in $scope.enteredValues)
 delete $scope.enteredValues[field.name];
-
+
 });
+
 }
 
 }));
 
 };
+
+/**
+ * Returns the field most relevant to the user given the current state
+ * of the login process. This will normally be the first empty field.
+ *
+ * @return {Field}
+ */
 
 Review comment:
   Missing documentation for the return value.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [guacamole-client] m-khan-glyptodon opened a new pull request #419: Incorrect password field focus

2019-06-24 Thread GitBox
m-khan-glyptodon opened a new pull request #419: Incorrect password field focus
URL: https://github.com/apache/guacamole-client/pull/419
 
 
   Note: This is not specific to just password fields, but any field type in 
general.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [guacamole-client] mike-jumper opened a new pull request #418: GUACAMOLE-822: Correct retrieval of client identifier for connection groups.

2019-06-24 Thread GitBox
mike-jumper opened a new pull request #418: GUACAMOLE-822: Correct retrieval of 
client identifier for connection groups.
URL: https://github.com/apache/guacamole-client/pull/418
 
 
   Commit f92bf9c moved the `getClientIdentifier()` function to the 
`GroupListItem` class, thus making the function available as 
`item.getClientIdentifier()` within the connection or connection group 
templates referenced by an instance of the `guacGroupList` directive (see 
#391). That commit correctly updated all but the connection group template for 
the home screen, which was _incorrectly_ updated to reference the function as 
if it were directly on the scope. As such a function doesn't exist, AngularJS 
didn't substitute any value, resulting in non-functional connection group links.
   
   This change updates the home screen connection group template to retrieve 
the client identifier using `item.getClientIdentifier()`, as originally 
intended.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


Re: When it says "connection selection menu"...

2019-06-24 Thread Mike Jumper
On Sun, Jun 23, 2019 at 7:52 PM Mark Nolan  wrote:

> ... does it mean the list of connections on the home page after logging in?
>
> https://github.com/apache/guacamole-client/pull/417
>
>
No, it's referring to a dropdown of available connections within the
Guacamole menu. See:

* https://github.com/apache/guacamole-client/pull/391
* https://issues.apache.org/jira/browse/GUACAMOLE-723

If so, is it possible to make this functionality configurable since, in my
> set up, that host may not actually be running and the user may need to
> start it before connecting.
>

No. I don't know what you're doing specifically that would make the feature
problematic, or that would make the behavior of your extension fragile, but
I wouldn't expect it to be. The new UI element is powered by the same data
as the home screen and shares a common core. I would recommend (1) testing
your extension against this feature to see if updating it is even needed
and (2) updating it accordingly if things fail.

- Mike