You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@whimsical.apache.org by Craig Russell <ap...@gmail.com> on 2017/09/23 03:24:29 UTC

Agenda roll call issues

The agenda roll call has two issues:

1. While taking roll call, there is traffic between client and server much more than is needed. The client receives multiple refreshes of the roll for each participant. It is difficult to tell why the screen is refreshing. It's strange that the entire roll refreshes several times. I'd like to review the code and perhaps simplify it so that each participant tick box generates a single message to the server and a single message back. Maybe I'm dreaming.

2. Once participants are added, there is no way to remove them. They continue to appear like zombies. Fixing this will require some design work. We might need to keep track of:

participants who are in the agenda and not yet marked as present
participants who are in the agenda and are marked as present
non-participants who are in the agenda and were incorrectly marked as present
participants who are not in the agenda and are marked as present
non-participants who are not in the agenda and were incorrectly marked as present

In the attached screen shot, I made a few attempts to get David Fisher onto the agenda with sad results.

Craig


Craig L Russell
Secretary, Apache Software Foundation
clr@apache.org http://db.apache.org/jdo


Re: Agenda roll call issues

Posted by Sam Ruby <ru...@intertwingly.net>.
On Sun, Sep 24, 2017 at 1:06 PM, Craig Russell <ap...@gmail.com> wrote:
> Hi Sam,
>
>> On Sep 23, 2017, at 1:14 AM, Sam Ruby <ru...@intertwingly.net> wrote:
>>
>> On Fri, Sep 22, 2017 at 11:24 PM, Craig Russell <ap...@gmail.com> wrote:
>>>
>>> The agenda roll call has two issues:
>>>
>>> 1. While taking roll call, there is traffic between client and server much more than is needed. The client receives multiple refreshes of the roll for each participant. It is difficult to tell why the screen is refreshing. It's strange that the entire roll refreshes several times. I'd like to review the code and perhaps simplify it so that each participant tick box generates a single message to the server and a single message back. Maybe I'm dreaming.
>>
>> Here's the relevant code:
>>
>> https://github.com/apache/whimsy/blob/master/www/board/agenda/views/pages/roll-call.js.rb
>>
>> Notes:
>>
>> 1) self.pending is set to true whenever a checkbox is clicked or focus
>> leaves an input field (i.e. the place where you note arrival and exit
>> times) and the text in that input field has changed.
>>
>> 2) Whenever the screen is updated (line 206), self.pending is checked,
>> and if true, a single messages is sent to the server which gets a
>> single response, and self.pending is reset.  Note that JavaScript is
>> single threaded so this logic can't be interrupted; and that the
>> response (the do..end part of the post call) is processed
>> asynchronously.
>
> When taking roll, if things go well, it takes about three seconds per "present" person. Less time for known attendees such as the chair and secretary. It takes more than three seconds for the server to respond.
>
> My theory is that when multiple responses are pending at the server side, they get out of order. This would be fine if each response simply refreshed the single attendee it was created from. But if the response refreshes all of the attendees, what we see is flashbacks in time.
>
> I cannot understand what is happening with the post 'minute', data do |minutes| block. If several responses are executing this code out of order while other Attendees are being clicked, are the results still predictable?
>
> I'd say that it's better for the Attendees to not talk to the server until roll call is complete, except for looking up names for non-agenda guests. I'd be happy if there is a (Roll Call Complete) button that sends the currently visible roll call to the server, and initializes the Vote list for the resolution section. We can discuss how to handle the (joined at... left at) comments as a separate issue.

TL;DR: I may have fixed this.

Here's a four line fix, that should make things better:

https://github.com/apache/whimsy/commit/b0870f9b96961368cf4aaadcf6b4afb93874a9c4

Staring at the bottom, the clock counter in the header is incremented
before a request is sent to the server, and is decremented once a
response is received.  This counter controls the display of a tiny
hourglass in the left side of the header:

https://github.com/apache/whimsy/blob/5d77c2ba899dc21e62114a9c9b0508c0cff0ca29/www/board/agenda/views/layout/header.js.rb#L23

What this means is that you will see an hourglass whenever there are
uncompleted requests.

Now for the interesting part, the first two changed lines will return
the previous status while the clock_counter is greater than zero.
That will prevent items becoming unchecked (or rechecked) between the
times that you have made a change and the server catches up.

I ran various tests on this.  For one, I added a variable 0-30 second
delay on each request.  I opened two windows in secretary mode and
checked three names in one window and then three different names in
the other window.  I could see the names showing up one by one in the
minutes but neither one window changed during this time.  Once one
window completed, two of the three items checked by the other window
showed up.  Shortly thereafter the other window completed, and all six
names were checked on both windows.

I don't know how I would have done this with React.js; but it was
amazingly easy with Vue.js.

- Sam Ruby

Re: Agenda roll call issues

Posted by Craig Russell <ap...@gmail.com>.
Hi Sam,

> On Sep 23, 2017, at 1:14 AM, Sam Ruby <ru...@intertwingly.net> wrote:
> 
> On Fri, Sep 22, 2017 at 11:24 PM, Craig Russell <ap...@gmail.com> wrote:
>> 
>> The agenda roll call has two issues:
>> 
>> 1. While taking roll call, there is traffic between client and server much more than is needed. The client receives multiple refreshes of the roll for each participant. It is difficult to tell why the screen is refreshing. It's strange that the entire roll refreshes several times. I'd like to review the code and perhaps simplify it so that each participant tick box generates a single message to the server and a single message back. Maybe I'm dreaming.
> 
> Here's the relevant code:
> 
> https://github.com/apache/whimsy/blob/master/www/board/agenda/views/pages/roll-call.js.rb
> 
> Notes:
> 
> 1) self.pending is set to true whenever a checkbox is clicked or focus
> leaves an input field (i.e. the place where you note arrival and exit
> times) and the text in that input field has changed.
> 
> 2) Whenever the screen is updated (line 206), self.pending is checked,
> and if true, a single messages is sent to the server which gets a
> single response, and self.pending is reset.  Note that JavaScript is
> single threaded so this logic can't be interrupted; and that the
> response (the do..end part of the post call) is processed
> asynchronously.

When taking roll, if things go well, it takes about three seconds per "present" person. Less time for known attendees such as the chair and secretary. It takes more than three seconds for the server to respond.

My theory is that when multiple responses are pending at the server side, they get out of order. This would be fine if each response simply refreshed the single attendee it was created from. But if the response refreshes all of the attendees, what we see is flashbacks in time.

I cannot understand what is happening with the post 'minute', data do |minutes| block. If several responses are executing this code out of order while other Attendees are being clicked, are the results still predictable?

I'd say that it's better for the Attendees to not talk to the server until roll call is complete, except for looking up names for non-agenda guests. I'd be happy if there is a (Roll Call Complete) button that sends the currently visible roll call to the server, and initializes the Vote list for the resolution section. We can discuss how to handle the (joined at... left at) comments as a separate issue. 
> 
>> 2. Once participants are added, there is no way to remove them. They continue to appear like zombies. Fixing this will require some design work. We might need to keep track of:
>> 
>> participants who are in the agenda and not yet marked as present
>> participants who are in the agenda and are marked as present
>> non-participants who are in the agenda and were incorrectly marked as present
>> participants who are not in the agenda and are marked as present
>> non-participants who are not in the agenda and were incorrectly marked as present
> 
> I believe that much if not all of that is already tracked.  Here it
> may help to start with the server view of the state:
> 
> https://whimsy.apache.org/board/agenda/2017-09-20.yaml
> 
> In the roll-call.js.rb code linked above, search for "add remaining attendees".
> 
>> In the attached screen shot, I made a few attempts to get David Fisher onto the agenda with sad results.
> 
> One thing the current code supports is guests that are not committers.
> To add a non-committer, type their name and click the checkbox.  The
> problem here is that once added, they can not be removed from display.
> Note: this only affects the display: people who are not listed in the
> agenda and do not attend do not appear in the draft minutes.
> 
> A client side solution to this might be to NOT add an attendee to the
> list of people if they are not present (note: people listed in the
> agenda are added to separately).  This could be as simple as changing
> line 89 to
> 
>  people << person if person.present
> 
> The server will still track such names, but they won't appear on the
> roll call web page or in the draft minutes.
> 
> If it is desired to remove name from what the server is tracking, that
> code would go someplace in here:
> 
> https://github.com/apache/whimsy/blob/master/www/board/agenda/views/actions/minute.json.rb#L32
> 
> Perhaps something like:
> 
> attendance.delete_if do |name, records|
>  not records[:present] and not people.find {|id, person| person[:name] == name}
> end
> 
> Perhaps around line 89?

I'll have to take a bit more time to understand the walk-on code. 

Craig
> 
>> Craig
>> 
>> Craig L Russell
>> Secretary, Apache Software Foundation
>> clr@apache.org http://db.apache.org/jdo
> 
> - Sam Ruby

Craig L Russell
Secretary, Apache Software Foundation
clr@apache.org http://db.apache.org/jdo


Re: Agenda roll call issues

Posted by Sam Ruby <ru...@intertwingly.net>.
On Fri, Sep 22, 2017 at 11:24 PM, Craig Russell <ap...@gmail.com> wrote:
>
> The agenda roll call has two issues:
>
> 1. While taking roll call, there is traffic between client and server much more than is needed. The client receives multiple refreshes of the roll for each participant. It is difficult to tell why the screen is refreshing. It's strange that the entire roll refreshes several times. I'd like to review the code and perhaps simplify it so that each participant tick box generates a single message to the server and a single message back. Maybe I'm dreaming.

Here's the relevant code:

https://github.com/apache/whimsy/blob/master/www/board/agenda/views/pages/roll-call.js.rb

Notes:

1) self.pending is set to true whenever a checkbox is clicked or focus
leaves an input field (i.e. the place where you note arrival and exit
times) and the text in that input field has changed.

2) Whenever the screen is updated (line 206), self.pending is checked,
and if true, a single messages is sent to the server which gets a
single response, and self.pending is reset.  Note that JavaScript is
single threaded so this logic can't be interrupted; and that the
response (the do..end part of the post call) is processed
asynchronously.

> 2. Once participants are added, there is no way to remove them. They continue to appear like zombies. Fixing this will require some design work. We might need to keep track of:
>
> participants who are in the agenda and not yet marked as present
> participants who are in the agenda and are marked as present
> non-participants who are in the agenda and were incorrectly marked as present
> participants who are not in the agenda and are marked as present
> non-participants who are not in the agenda and were incorrectly marked as present

I believe that much if not all of that is already tracked.  Here it
may help to start with the server view of the state:

https://whimsy.apache.org/board/agenda/2017-09-20.yaml

In the roll-call.js.rb code linked above, search for "add remaining attendees".

> In the attached screen shot, I made a few attempts to get David Fisher onto the agenda with sad results.

One thing the current code supports is guests that are not committers.
To add a non-committer, type their name and click the checkbox.  The
problem here is that once added, they can not be removed from display.
Note: this only affects the display: people who are not listed in the
agenda and do not attend do not appear in the draft minutes.

A client side solution to this might be to NOT add an attended to the
list of people if they are not present (note: people listed in the
agenda are added to separately).  This could be as simple as changing
line 89 to

  people << person if person.present

The server will still track such names, but they won't appear on the
roll call web page or in the draft minutes.

If it is desired to remove name from what the server is tracking, that
code would go someplace in here:

https://github.com/apache/whimsy/blob/master/www/board/agenda/views/actions/minute.json.rb#L32

Perhaps something like:

attendance.delete_if do |name, records|
  not records[:present] and not people.find {|id, person| person[:name] == name}
end

Perhaps around line 89?

> Craig
>
> Craig L Russell
> Secretary, Apache Software Foundation
> clr@apache.org http://db.apache.org/jdo

- Sam Ruby