LONG_POLL when clicking on browse items & categories

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

LONG_POLL when clicking on browse items & categories

Dean Junk

While trying to debug my reverse proxy with ssl to misterhouse, I noticed in the developer console under network, LONG_POLL is called repeatedly on the browse items and categories pages. The only way to make it stop is to browse off of those pages. At first I thought it might be my reverse proxy setup, but I also saw the same behavior when accessing misterhouse directly using normal http. The pages are displayed immediately, but the call to LONG_POLL seems infinite.


Bug or feature?


Thanks!


------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users

Reply | Threaded
Open this post in threaded view
|

Re: LONG_POLL when clicking on browse items & categories

H Plato
Probably a feature. That’s how the ‘IA7 Server push' design works, a long_poll is generated which keeps the connection open until new data arrives, or the connection times out. The javascript on the page processes the data, and then calls it again.

It could be a ‘bug’, since the downside of this approach causes more CPU cycles for the MH process as json_server constantly checks if new data is available to push to the client.


On Mar 12, 2017, at 12:24 PM, Dean Junk <[hidden email]> wrote:

While trying to debug my reverse proxy with ssl to misterhouse, I noticed in the developer console under network, LONG_POLL is called repeatedly on the browse items and categories pages. The only way to make it stop is to browse off of those pages. At first I thought it might be my reverse proxy setup, but I also saw the same behavior when accessing misterhouse directly using normal http. The pages are displayed immediately, but the call to LONG_POLL seems infinite.

Bug or feature?

Thanks!
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users


------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users

Reply | Threaded
Open this post in threaded view
|

Re: LONG_POLL when clicking on browse items & categories

Dean Junk
I think it's a bug since on all other pages you see the long poll executed every so often if you let the page be idle, but on these pages you can barely read a line on the network tab since long poll is being called so often.
 
On 3/12/17 3:58 PM, [hidden email] wrote:
Probably a feature. That’s how the ‘IA7 Server push' design works, a long_poll is generated which keeps the connection open until new data arrives, or the connection times out. The javascript on the page processes the data, and then calls it again.

It could be a ‘bug’, since the downside of this approach causes more CPU cycles for the MH process as json_server constantly checks if new data is available to push to the client.


On Mar 12, 2017, at 12:24 PM, Dean Junk <[hidden email]> wrote:

While trying to debug my reverse proxy with ssl to misterhouse, I noticed in the developer console under network, LONG_POLL is called repeatedly on the browse items and categories pages. The only way to make it stop is to browse off of those pages. At first I thought it might be my reverse proxy setup, but I also saw the same behavior when accessing misterhouse directly using normal http. The pages are displayed immediately, but the call to LONG_POLL seems infinite.

Bug or feature?

Thanks!
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users



------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users

Reply | Threaded
Open this post in threaded view
|

Re: LONG_POLL when clicking on browse items & categories

H Plato
I think I see what you mean. A page like this:


Generates about 6 - 10 requests a second from my server.

So, yes that probably a bug. It’s been this way since the prototype, but definitely this could be looked at to only send data back when the requested data changes. I’m guessing this returns right away on all calls since at least one object in MH meets these conditions all the time:

        if ( !( $object->can('get_idle_time') ) ) {

            #Items that do not have an idle time do not get reported at all in updates
            return;
        }
        elsif ( $object->get_idle_time eq '' ) {

            #Items that have NEVER been set to a state have a null idle time
            return;
        }
        elsif  (( $request_time - 1 ) > ( $current_time - $object->get_idle_time ) )
        {

            #To avoid missed changes, since they can happen at the millisecond level, give a second's cushion
            #Object has not changed since time, so return undefined
            return;
        }

json_server optimization should be on the todo list for 4.3. It would be great to fix this, and to reduce the CPU overhead of the json_server polling.


On Mar 12, 2017, at 3:28 PM, Dean Junk <[hidden email]> wrote:

I think it's a bug since on all other pages you see the long poll executed every so often if you let the page be idle, but on these pages you can barely read a line on the network tab since long poll is being called so often.
 
On 3/12/17 3:58 PM, [hidden email] wrote:
Probably a feature. That’s how the ‘IA7 Server push' design works, a long_poll is generated which keeps the connection open until new data arrives, or the connection times out. The javascript on the page processes the data, and then calls it again.

It could be a ‘bug’, since the downside of this approach causes more CPU cycles for the MH process as json_server constantly checks if new data is available to push to the client.


On Mar 12, 2017, at 12:24 PM, Dean Junk <[hidden email]> wrote:

While trying to debug my reverse proxy with ssl to misterhouse, I noticed in the developer console under network, LONG_POLL is called repeatedly on the browse items and categories pages. The only way to make it stop is to browse off of those pages. At first I thought it might be my reverse proxy setup, but I also saw the same behavior when accessing misterhouse directly using normal http. The pages are displayed immediately, but the call to LONG_POLL seems infinite.

Bug or feature?

Thanks!
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users




------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users

Reply | Threaded
Open this post in threaded view
|

Re: LONG_POLL when clicking on browse items & categories

Dean Junk
Yes, that is exactly what I was seeing.

On 3/12/17 7:37 PM, H Plato wrote:
I think I see what you mean. A page like this:


Generates about 6 - 10 requests a second from my server.

So, yes that probably a bug. It’s been this way since the prototype, but definitely this could be looked at to only send data back when the requested data changes. I’m guessing this returns right away on all calls since at least one object in MH meets these conditions all the time:

        if ( !( $object->can('get_idle_time') ) ) {

            #Items that do not have an idle time do not get reported at all in updates
            return;
        }
        elsif ( $object->get_idle_time eq '' ) {

            #Items that have NEVER been set to a state have a null idle time
            return;
        }
        elsif  (( $request_time - 1 ) > ( $current_time - $object->get_idle_time ) )
        {

            #To avoid missed changes, since they can happen at the millisecond level, give a second's cushion
            #Object has not changed since time, so return undefined
            return;
        }

json_server optimization should be on the todo list for 4.3. It would be great to fix this, and to reduce the CPU overhead of the json_server polling.


On Mar 12, 2017, at 3:28 PM, Dean Junk <[hidden email]> wrote:

I think it's a bug since on all other pages you see the long poll executed every so often if you let the page be idle, but on these pages you can barely read a line on the network tab since long poll is being called so often.
 
On 3/12/17 3:58 PM, [hidden email] wrote:
Probably a feature. That’s how the ‘IA7 Server push' design works, a long_poll is generated which keeps the connection open until new data arrives, or the connection times out. The javascript on the page processes the data, and then calls it again.

It could be a ‘bug’, since the downside of this approach causes more CPU cycles for the MH process as json_server constantly checks if new data is available to push to the client.


On Mar 12, 2017, at 12:24 PM, Dean Junk <[hidden email]> wrote:

While trying to debug my reverse proxy with ssl to misterhouse, I noticed in the developer console under network, LONG_POLL is called repeatedly on the browse items and categories pages. The only way to make it stop is to browse off of those pages. At first I thought it might be my reverse proxy setup, but I also saw the same behavior when accessing misterhouse directly using normal http. The pages are displayed immediately, but the call to LONG_POLL seems infinite.

Bug or feature?

Thanks!
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users





------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users

Reply | Threaded
Open this post in threaded view
|

Re: LONG_POLL when clicking on browse items & categories

H Plato
I dug into the issue and put a fix on my github ia7 branch if you want to test it out. Seems to work properly, but I haven’t tested everything yet.


On Mar 12, 2017, at 6:41 PM, Dean Junk <[hidden email]> wrote:

Yes, that is exactly what I was seeing.

On 3/12/17 7:37 PM, H Plato wrote:
I think I see what you mean. A page like this:


Generates about 6 - 10 requests a second from my server.

So, yes that probably a bug. It’s been this way since the prototype, but definitely this could be looked at to only send data back when the requested data changes. I’m guessing this returns right away on all calls since at least one object in MH meets these conditions all the time:

        if ( !( $object->can('get_idle_time') ) ) {

            #Items that do not have an idle time do not get reported at all in updates
            return;
        }
        elsif ( $object->get_idle_time eq '' ) {

            #Items that have NEVER been set to a state have a null idle time
            return;
        }
        elsif  (( $request_time - 1 ) > ( $current_time - $object->get_idle_time ) )
        {

            #To avoid missed changes, since they can happen at the millisecond level, give a second's cushion
            #Object has not changed since time, so return undefined
            return;
        }

json_server optimization should be on the todo list for 4.3. It would be great to fix this, and to reduce the CPU overhead of the json_server polling.


On Mar 12, 2017, at 3:28 PM, Dean Junk <[hidden email]> wrote:

I think it's a bug since on all other pages you see the long poll executed every so often if you let the page be idle, but on these pages you can barely read a line on the network tab since long poll is being called so often.
 
On 3/12/17 3:58 PM, [hidden email] wrote:
Probably a feature. That’s how the ‘IA7 Server push' design works, a long_poll is generated which keeps the connection open until new data arrives, or the connection times out. The javascript on the page processes the data, and then calls it again.

It could be a ‘bug’, since the downside of this approach causes more CPU cycles for the MH process as json_server constantly checks if new data is available to push to the client.


On Mar 12, 2017, at 12:24 PM, Dean Junk <[hidden email]> wrote:

While trying to debug my reverse proxy with ssl to misterhouse, I noticed in the developer console under network, LONG_POLL is called repeatedly on the browse items and categories pages. The only way to make it stop is to browse off of those pages. At first I thought it might be my reverse proxy setup, but I also saw the same behavior when accessing misterhouse directly using normal http. The pages are displayed immediately, but the call to LONG_POLL seems infinite.

Bug or feature?

Thanks!
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users






------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users

Reply | Threaded
Open this post in threaded view
|

Re: LONG_POLL when clicking on browse items & categories

Dean Junk
Thanks! I will test it out this weekend.

On 3/30/17 6:45 PM, H Plato wrote:
I dug into the issue and put a fix on my github ia7 branch if you want to test it out. Seems to work properly, but I haven’t tested everything yet.


On Mar 12, 2017, at 6:41 PM, Dean Junk <[hidden email]> wrote:

Yes, that is exactly what I was seeing.

On 3/12/17 7:37 PM, H Plato wrote:
I think I see what you mean. A page like this:


Generates about 6 - 10 requests a second from my server.

So, yes that probably a bug. It’s been this way since the prototype, but definitely this could be looked at to only send data back when the requested data changes. I’m guessing this returns right away on all calls since at least one object in MH meets these conditions all the time:

        if ( !( $object->can('get_idle_time') ) ) {

            #Items that do not have an idle time do not get reported at all in updates
            return;
        }
        elsif ( $object->get_idle_time eq '' ) {

            #Items that have NEVER been set to a state have a null idle time
            return;
        }
        elsif  (( $request_time - 1 ) > ( $current_time - $object->get_idle_time ) )
        {

            #To avoid missed changes, since they can happen at the millisecond level, give a second's cushion
            #Object has not changed since time, so return undefined
            return;
        }

json_server optimization should be on the todo list for 4.3. It would be great to fix this, and to reduce the CPU overhead of the json_server polling.


On Mar 12, 2017, at 3:28 PM, Dean Junk <[hidden email]> wrote:

I think it's a bug since on all other pages you see the long poll executed every so often if you let the page be idle, but on these pages you can barely read a line on the network tab since long poll is being called so often.
 
On 3/12/17 3:58 PM, [hidden email] wrote:
Probably a feature. That’s how the ‘IA7 Server push' design works, a long_poll is generated which keeps the connection open until new data arrives, or the connection times out. The javascript on the page processes the data, and then calls it again.

It could be a ‘bug’, since the downside of this approach causes more CPU cycles for the MH process as json_server constantly checks if new data is available to push to the client.


On Mar 12, 2017, at 12:24 PM, Dean Junk <[hidden email]> wrote:

While trying to debug my reverse proxy with ssl to misterhouse, I noticed in the developer console under network, LONG_POLL is called repeatedly on the browse items and categories pages. The only way to make it stop is to browse off of those pages. At first I thought it might be my reverse proxy setup, but I also saw the same behavior when accessing misterhouse directly using normal http. The pages are displayed immediately, but the call to LONG_POLL seems infinite.

Bug or feature?

Thanks!
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users







------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users

Reply | Threaded
Open this post in threaded view
|

Re: LONG_POLL when clicking on browse items & categories

Dean Junk
I tried testing the fix and ran into a different problem (I think from an apt-get upgrade). Anyway, I get the header, the footer, and nothing in between that would be from the collections.json. What's the best way to debug this issue? The issue showed up after a reboot and not after the patch (which is why I think an update from apt-get caused the issue).

Thanks!

On 3/31/17 5:02 AM, Dean Junk wrote:
Thanks! I will test it out this weekend.

On 3/30/17 6:45 PM, H Plato wrote:
I dug into the issue and put a fix on my github ia7 branch if you want to test it out. Seems to work properly, but I haven’t tested everything yet.


On Mar 12, 2017, at 6:41 PM, Dean Junk <[hidden email]> wrote:

Yes, that is exactly what I was seeing.

On 3/12/17 7:37 PM, H Plato wrote:
I think I see what you mean. A page like this:


Generates about 6 - 10 requests a second from my server.

So, yes that probably a bug. It’s been this way since the prototype, but definitely this could be looked at to only send data back when the requested data changes. I’m guessing this returns right away on all calls since at least one object in MH meets these conditions all the time:

        if ( !( $object->can('get_idle_time') ) ) {

            #Items that do not have an idle time do not get reported at all in updates
            return;
        }
        elsif ( $object->get_idle_time eq '' ) {

            #Items that have NEVER been set to a state have a null idle time
            return;
        }
        elsif  (( $request_time - 1 ) > ( $current_time - $object->get_idle_time ) )
        {

            #To avoid missed changes, since they can happen at the millisecond level, give a second's cushion
            #Object has not changed since time, so return undefined
            return;
        }

json_server optimization should be on the todo list for 4.3. It would be great to fix this, and to reduce the CPU overhead of the json_server polling.


On Mar 12, 2017, at 3:28 PM, Dean Junk <[hidden email]> wrote:

I think it's a bug since on all other pages you see the long poll executed every so often if you let the page be idle, but on these pages you can barely read a line on the network tab since long poll is being called so often.
 
On 3/12/17 3:58 PM, [hidden email] wrote:
Probably a feature. That’s how the ‘IA7 Server push' design works, a long_poll is generated which keeps the connection open until new data arrives, or the connection times out. The javascript on the page processes the data, and then calls it again.

It could be a ‘bug’, since the downside of this approach causes more CPU cycles for the MH process as json_server constantly checks if new data is available to push to the client.


On Mar 12, 2017, at 12:24 PM, Dean Junk <[hidden email]> wrote:

While trying to debug my reverse proxy with ssl to misterhouse, I noticed in the developer console under network, LONG_POLL is called repeatedly on the browse items and categories pages. The only way to make it stop is to browse off of those pages. At first I thought it might be my reverse proxy setup, but I also saw the same behavior when accessing misterhouse directly using normal http. The pages are displayed immediately, but the call to LONG_POLL seems infinite.

Bug or feature?

Thanks!
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users








------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users

Reply | Threaded
Open this post in threaded view
|

Re: LONG_POLL when clicking on browse items & categories

H Plato
The javascript console is the best way. If you have chrome, right click on something, inspect element, select console and then reload the page. 

You can also look in the mh print log, if there is a problem with your collections.json file, there will be some information. 

Sent from my mobile device. 

On Apr 2, 2017, at 4:23 PM, Dean Junk <[hidden email]> wrote:

I tried testing the fix and ran into a different problem (I think from an apt-get upgrade). Anyway, I get the header, the footer, and nothing in between that would be from the collections.json. What's the best way to debug this issue? The issue showed up after a reboot and not after the patch (which is why I think an update from apt-get caused the issue).

Thanks!

On 3/31/17 5:02 AM, Dean Junk wrote:
Thanks! I will test it out this weekend.

On 3/30/17 6:45 PM, H Plato wrote:
I dug into the issue and put a fix on my github ia7 branch if you want to test it out. Seems to work properly, but I haven’t tested everything yet.


On Mar 12, 2017, at 6:41 PM, Dean Junk <[hidden email]> wrote:

Yes, that is exactly what I was seeing.

On 3/12/17 7:37 PM, H Plato wrote:
I think I see what you mean. A page like this:


Generates about 6 - 10 requests a second from my server.

So, yes that probably a bug. It’s been this way since the prototype, but definitely this could be looked at to only send data back when the requested data changes. I’m guessing this returns right away on all calls since at least one object in MH meets these conditions all the time:

        if ( !( $object->can('get_idle_time') ) ) {

            #Items that do not have an idle time do not get reported at all in updates
            return;
        }
        elsif ( $object->get_idle_time eq '' ) {

            #Items that have NEVER been set to a state have a null idle time
            return;
        }
        elsif  (( $request_time - 1 ) > ( $current_time - $object->get_idle_time ) )
        {

            #To avoid missed changes, since they can happen at the millisecond level, give a second's cushion
            #Object has not changed since time, so return undefined
            return;
        }

json_server optimization should be on the todo list for 4.3. It would be great to fix this, and to reduce the CPU overhead of the json_server polling.


On Mar 12, 2017, at 3:28 PM, Dean Junk <[hidden email]> wrote:

I think it's a bug since on all other pages you see the long poll executed every so often if you let the page be idle, but on these pages you can barely read a line on the network tab since long poll is being called so often.
 
On 3/12/17 3:58 PM, [hidden email] wrote:
Probably a feature. That’s how the ‘IA7 Server push' design works, a long_poll is generated which keeps the connection open until new data arrives, or the connection times out. The javascript on the page processes the data, and then calls it again.

It could be a ‘bug’, since the downside of this approach causes more CPU cycles for the MH process as json_server constantly checks if new data is available to push to the client.


On Mar 12, 2017, at 12:24 PM, Dean Junk <[hidden email]> wrote:

While trying to debug my reverse proxy with ssl to misterhouse, I noticed in the developer console under network, LONG_POLL is called repeatedly on the browse items and categories pages. The only way to make it stop is to browse off of those pages. At first I thought it might be my reverse proxy setup, but I also saw the same behavior when accessing misterhouse directly using normal http. The pages are displayed immediately, but the call to LONG_POLL seems infinite.

Bug or feature?

Thanks!
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users








------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users

Reply | Threaded
Open this post in threaded view
|

Re: LONG_POLL when clicking on browse items & categories

Dean Junk
The only thing that shows up in the console is:
failed_request.shtml:1 Uncaught SyntaxError: Unexpected token <

Print.log shows:
Unrecognized html request: get_req=/javascript/jquery/jquery.csvToTable.js get_arg=  header=GET /javascript/jquery/jquery.csvToTable.js HTTP/1.1

On 4/2/17 5:53 PM, H Plato wrote:
The javascript console is the best way. If you have chrome, right click on something, inspect element, select console and then reload the page. 

You can also look in the mh print log, if there is a problem with your collections.json file, there will be some information. 

Sent from my mobile device. 

On Apr 2, 2017, at 4:23 PM, Dean Junk <[hidden email]> wrote:

I tried testing the fix and ran into a different problem (I think from an apt-get upgrade). Anyway, I get the header, the footer, and nothing in between that would be from the collections.json. What's the best way to debug this issue? The issue showed up after a reboot and not after the patch (which is why I think an update from apt-get caused the issue).

Thanks!

On 3/31/17 5:02 AM, Dean Junk wrote:
Thanks! I will test it out this weekend.

On 3/30/17 6:45 PM, H Plato wrote:
I dug into the issue and put a fix on my github ia7 branch if you want to test it out. Seems to work properly, but I haven’t tested everything yet.


On Mar 12, 2017, at 6:41 PM, Dean Junk <[hidden email]> wrote:

Yes, that is exactly what I was seeing.

On 3/12/17 7:37 PM, H Plato wrote:
I think I see what you mean. A page like this:


Generates about 6 - 10 requests a second from my server.

So, yes that probably a bug. It’s been this way since the prototype, but definitely this could be looked at to only send data back when the requested data changes. I’m guessing this returns right away on all calls since at least one object in MH meets these conditions all the time:

        if ( !( $object->can('get_idle_time') ) ) {

            #Items that do not have an idle time do not get reported at all in updates
            return;
        }
        elsif ( $object->get_idle_time eq '' ) {

            #Items that have NEVER been set to a state have a null idle time
            return;
        }
        elsif  (( $request_time - 1 ) > ( $current_time - $object->get_idle_time ) )
        {

            #To avoid missed changes, since they can happen at the millisecond level, give a second's cushion
            #Object has not changed since time, so return undefined
            return;
        }

json_server optimization should be on the todo list for 4.3. It would be great to fix this, and to reduce the CPU overhead of the json_server polling.


On Mar 12, 2017, at 3:28 PM, Dean Junk <[hidden email]> wrote:

I think it's a bug since on all other pages you see the long poll executed every so often if you let the page be idle, but on these pages you can barely read a line on the network tab since long poll is being called so often.
 
On 3/12/17 3:58 PM, [hidden email] wrote:
Probably a feature. That’s how the ‘IA7 Server push' design works, a long_poll is generated which keeps the connection open until new data arrives, or the connection times out. The javascript on the page processes the data, and then calls it again.

It could be a ‘bug’, since the downside of this approach causes more CPU cycles for the MH process as json_server constantly checks if new data is available to push to the client.


On Mar 12, 2017, at 12:24 PM, Dean Junk <[hidden email]> wrote:

While trying to debug my reverse proxy with ssl to misterhouse, I noticed in the developer console under network, LONG_POLL is called repeatedly on the browse items and categories pages. The only way to make it stop is to browse off of those pages. At first I thought it might be my reverse proxy setup, but I also saw the same behavior when accessing misterhouse directly using normal http. The pages are displayed immediately, but the call to LONG_POLL seems infinite.

Bug or feature?

Thanks!
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users









------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users

Reply | Threaded
Open this post in threaded view
|

Re: LONG_POLL when clicking on browse items & categories

H Plato

I don’t think this isn’t part of the IA7 code I added, so I’m not sure what to suggest.


On Apr 2, 2017, at 5:28 PM, Dean Junk <[hidden email]> wrote:

The only thing that shows up in the console is:
failed_request.shtml:1 Uncaught SyntaxError: Unexpected token <

Print.log shows:
Unrecognized html request: get_req=/javascript/jquery/jquery.csvToTable.js get_arg=  header=GET /javascript/jquery/jquery.csvToTable.js HTTP/1.1

On 4/2/17 5:53 PM, H Plato wrote:
The javascript console is the best way. If you have chrome, right click on something, inspect element, select console and then reload the page. 

You can also look in the mh print log, if there is a problem with your collections.json file, there will be some information. 

Sent from my mobile device. 

On Apr 2, 2017, at 4:23 PM, Dean Junk <[hidden email]> wrote:

I tried testing the fix and ran into a different problem (I think from an apt-get upgrade). Anyway, I get the header, the footer, and nothing in between that would be from the collections.json. What's the best way to debug this issue? The issue showed up after a reboot and not after the patch (which is why I think an update from apt-get caused the issue).

Thanks!

On 3/31/17 5:02 AM, Dean Junk wrote:
Thanks! I will test it out this weekend.

On 3/30/17 6:45 PM, H Plato wrote:
I dug into the issue and put a fix on my github ia7 branch if you want to test it out. Seems to work properly, but I haven’t tested everything yet.


On Mar 12, 2017, at 6:41 PM, Dean Junk <[hidden email]> wrote:

Yes, that is exactly what I was seeing.

On 3/12/17 7:37 PM, H Plato wrote:
I think I see what you mean. A page like this:


Generates about 6 - 10 requests a second from my server.

So, yes that probably a bug. It’s been this way since the prototype, but definitely this could be looked at to only send data back when the requested data changes. I’m guessing this returns right away on all calls since at least one object in MH meets these conditions all the time:

        if ( !( $object->can('get_idle_time') ) ) {

            #Items that do not have an idle time do not get reported at all in updates
            return;
        }
        elsif ( $object->get_idle_time eq '' ) {

            #Items that have NEVER been set to a state have a null idle time
            return;
        }
        elsif  (( $request_time - 1 ) > ( $current_time - $object->get_idle_time ) )
        {

            #To avoid missed changes, since they can happen at the millisecond level, give a second's cushion
            #Object has not changed since time, so return undefined
            return;
        }

json_server optimization should be on the todo list for 4.3. It would be great to fix this, and to reduce the CPU overhead of the json_server polling.


On Mar 12, 2017, at 3:28 PM, Dean Junk <[hidden email]> wrote:

I think it's a bug since on all other pages you see the long poll executed every so often if you let the page be idle, but on these pages you can barely read a line on the network tab since long poll is being called so often.
 
On 3/12/17 3:58 PM, [hidden email] wrote:
Probably a feature. That’s how the ‘IA7 Server push' design works, a long_poll is generated which keeps the connection open until new data arrives, or the connection times out. The javascript on the page processes the data, and then calls it again.

It could be a ‘bug’, since the downside of this approach causes more CPU cycles for the MH process as json_server constantly checks if new data is available to push to the client.


On Mar 12, 2017, at 12:24 PM, Dean Junk <[hidden email]> wrote:

While trying to debug my reverse proxy with ssl to misterhouse, I noticed in the developer console under network, LONG_POLL is called repeatedly on the browse items and categories pages. The only way to make it stop is to browse off of those pages. At first I thought it might be my reverse proxy setup, but I also saw the same behavior when accessing misterhouse directly using normal http. The pages are displayed immediately, but the call to LONG_POLL seems infinite.

Bug or feature?

Thanks!
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users










------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users

Reply | Threaded
Open this post in threaded view
|

Re: LONG_POLL when clicking on browse items & categories

Dean Junk
Just to be safe, I downloaded stable to a new directory, created new code and data directories and updated my private.ini to point to the new directories. Same result:

get the header that has "Misterhouse a button with checking as the label and settings button"
a grey thin bar where the main misterhouse buttons should be
a footer with a daily quote
another line in the footer with machine usage stats.

The terminal on startup shows:

Command: mh
Pgm  path   : /home/mrhouse/mh_4.2/bin
Pgm  version: 4.2 
Last updated: Sun Apr  2 20:16:15 2017
Perl version: 5.022001
OS   version: linux linux 
Other       : user=mrhouse pid=22826 box= cpu=-

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

Read parameter files: ./mh.ini ./mh.private.ini /home/mrhouse/code/mh.private.ini
Debugging for insteon turned on
Debugging for x10 turned on
Debugging for w800 turned on
Code Directories:
 - /home/mrhouse/code2/
 - ./../code/common
Loading other modules
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\$::Weather{ <-- HERE (.*?)}/ at /home/mrhouse/mh_4.2/bin/../lib/Weather_Item.pm line 96.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/-\>{ <-- HERE state}=(.*);/ at /home/mrhouse/mh_4.2/bin/../lib/Light_Item.pm line 992.
Starting setup
 - using simple Text distance function
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/'}{ <-- HERE '/ at /home/mrhouse/mh_4.2/bin/../lib/json_server.pl line 819.
 - reading previous log files
tail function error, could not open /home/mrhouse/data2//logs/print.log: No such file or directory
tail function error, could not open /home/mrhouse/data2//logs/speak.log: No such file or directory
tail function error, could not open /home/mrhouse/data2//logs/error.log: No such file or directory
 - archiving previous /home/mrhouse/data2//logs/*.log files .Warning, could not open file_cat /home/mrhouse/data2//logs/error.log: No such file or directory
.Warning, could not open file_cat /home/mrhouse/data2//logs/print.log: No such file or directory
.Warning, could not open file_cat /home/mrhouse/data2//logs/speak.log: No such file or directory
.
 - creating http            on tcp   8082 buffered
 - creating server mhsend   on tcp   8084 buffered
 - creating server telnet   on tcp   1234 raw
 - creating xap_send        on udp  3639 send
 - creating xap_listen_core on udp 49152 listen
 - creating xpl_send        on udp  3865 send
 - creating xpl_listen      on udp 49352 listen
 - initializing state tracker ...
 - creating W800 port on /dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0
02/04/2017 08:23:32 PM [Insteon_PLM] serial:/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A600B3FN-if00-port0:19200
 - creating Insteon PLM port on /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A600B3FN-if00-port0
 - object logging disabled
 - process id 22826 written to /home/mrhouse/data2//mh.pid
 - external command file (xcmd_file): ./../house_cmd.txt
 - HTML file     : ./../web/ia5/index.shtml

Warning:  password_file /home/mrhouse/data2//.password not found.  Run mh/bin/set_password

Done with setup

02/04/2017 08:23:32 PM [IA7_Collection_Updater] : Starting
02/04/2017 08:23:32 PM [IA7_Collection_Updater] : Reviewing ./../data/web/collections.json to current version 1.2
02/04/2017 08:23:32 PM [IA7_Collection_Updater] : Finished
02/04/2017 08:23:32 PM Perl @INC contains: /home/mrhouse/code2/, ./../code/common, /home/mrhouse/mh_4.2/bin/../lib, /home/mrhouse/mh_4.2/bin/../lib/site, ., /etc/perl, /usr/local/lib/x86_64-linux-gnu/perl/5.22.1, /usr/local/share/perl/5.22.1, /usr/lib/x86_64-linux-gnu/perl5/5.22, /usr/share/perl5, /usr/lib/x86_64-linux-gnu/perl/5.22, /usr/share/perl/5.22, /usr/local/lib/site_perl, /usr/lib/x86_64-linux-gnu/perl-base, .
02/04/2017 08:23:32 PM Reading /home/mrhouse/code/mh.private.ini and mh.ini
   html_alias alias /photos_big dir does not exist, dir=$config_parms{data_dir}/photos
   html_alias alias /photos dir does not exist, dir=/home/mrhouse/data2//photos
   html_alias alias /email dir does not exist, dir=/home/mrhouse/data2//email
   html_alias alias /tv dir does not exist, dir=/home/mrhouse/data2//tv
   html_alias alias /rrd dir does not exist, dir=/home/mrhouse/data2//rrd
Voice names: Microsoft Mary, Microsoft Mike, Microsoft Sam
Read 4 entries from ./../data/pronouncable_words.list

Error, could not find the caller id file /home/mrhouse/data2//phone/phone.caller_id.list: No such file or directory
Reading code_dirs: /home/mrhouse/code2/ ./../code/common
02/04/2017 08:23:32 PM Reading 13 code files
02/04/2017 08:23:32 PM Evaluating user code

Good code saved
02/04/2017 08:23:32 PM FUNCTION: set_volume_pre_hook
02/04/2017 08:23:32 PM running: play ./../sounds/sound_click1.wav

Restoring object states
Object states restored
Activating voice commands
Starting monitor commands loop

Latitude: 41.726788,  Longitude: -93.604283,  Time Zone: -6
sunrise=6:56 AM sunset=7:41 PM
sunrise twilight=6:28 AM sunset twilight=8:09 PM
The moon is Half Waxing, 39% bright, and 6 days old
The next full moon is on Wednesday, May 10th

./../sounds/sound_click1.wav:

 File Size: 908       Bit Rate: 186k
  Encoding: Unsigned PCM 
  Channels: 1 @ 8-bit   
Samplerate: 22050Hz     
Replaygain: off        
  Duration: 00:00:00.04 

In:100%  00:00:00.04 [00:00:00.00] Out:1.87k [!=====|=====!]        Clip:26  
play WARN rate: rate clipped 14 samples; decrease volume?
play WARN dither: dither clipped 12 samples; decrease volume?
Done.
02/04/2017 08:23:33 PM Rereading .menu code files.
02/04/2017 08:23:33 PM Organizer: Calendar matches target schema and does not require upgrading
02/04/2017 08:23:33 PM Organizer: Todo matches target schema and does not require upgrading
02/04/2017 08:23:33 PM Organizer: Reading updated organizer calendar file now
setting $organizer_vacation
setting $organizer_holidays
setting $organizer_events
02/04/2017 08:23:33 PM Evaluating code organizer_events
02/04/2017 08:23:33 PM Organizer: Reading updated organizer todo file
Bad time format:  12:00 am + 23:59   caller=main /home/mrhouse/mh_4.2/bin/mh 7407
db mday=2 mdayf=4 min=23 minf=00 secf=0 hour=20 hourf=12 ap=AM m=4 mf=14 y=2017 yf=137
02/04/2017 08:23:33 PM Evaluating code organizer_tasks


The Print log shows:

02/04/2017 08:23:32 PM ---------- Restart ----------
02/04/2017 08:23:32 PM [Insteon_PLM] serial:/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A600B3FN-if00-port0:19200
02/04/2017 08:23:32 PM [IA7_Collection_Updater] : Starting
02/04/2017 08:23:32 PM [IA7_Collection_Updater] : Reviewing ./../data/web/collections.json to current version 1.2
02/04/2017 08:23:32 PM [IA7_Collection_Updater] : Finished
02/04/2017 08:23:32 PM Perl @INC contains: /home/mrhouse/code2/, ./../code/common, /home/mrhouse/mh_4.2/bin/../lib, /home/mrhouse/mh_4.2/bin/../lib/site, ., /etc/perl, /usr/local/lib/x86_64-linux-gnu/perl/5.22.1, /usr/local/share/perl/5.22.1, /usr/lib/x86_64-linux-gnu/perl5/5.22, /usr/share/perl5, /usr/lib/x86_64-linux-gnu/perl/5.22, /usr/share/perl/5.22, /usr/local/lib/site_perl, /usr/lib/x86_64-linux-gnu/perl-base, .
02/04/2017 08:23:32 PM Reading /home/mrhouse/code/mh.private.ini and mh.ini
02/04/2017 08:23:32 PM Reading 13 code files
02/04/2017 08:23:32 PM Evaluating user code
02/04/2017 08:23:32 PM FUNCTION: set_volume_pre_hook
02/04/2017 08:23:32 PM running: play ./../sounds/sound_click1.wav
02/04/2017 08:23:33 PM Rereading .menu code files.
02/04/2017 08:23:33 PM Organizer: Calendar matches target schema and does not require upgrading
02/04/2017 08:23:33 PM Organizer: Todo matches target schema and does not require upgrading
02/04/2017 08:23:33 PM Organizer: Reading updated organizer calendar file now
02/04/2017 08:23:33 PM Evaluating code organizer_events
02/04/2017 08:23:33 PM Organizer: Reading updated organizer todo file
02/04/2017 08:23:33 PM Evaluating code organizer_tasks

Can I run something from command line that would produce the html for the objects in the collections.json to try and debug?

Any help would be greatly appreciated!

Thanks!

On 4/2/17 7:36 PM, H Plato wrote:

I don’t think this isn’t part of the IA7 code I added, so I’m not sure what to suggest.


On Apr 2, 2017, at 5:28 PM, Dean Junk <[hidden email]> wrote:

The only thing that shows up in the console is:
failed_request.shtml:1 Uncaught SyntaxError: Unexpected token <

Print.log shows:
Unrecognized html request: get_req=/javascript/jquery/jquery.csvToTable.js get_arg=  header=GET /javascript/jquery/jquery.csvToTable.js HTTP/1.1

On 4/2/17 5:53 PM, H Plato wrote:
The javascript console is the best way. If you have chrome, right click on something, inspect element, select console and then reload the page. 

You can also look in the mh print log, if there is a problem with your collections.json file, there will be some information. 

Sent from my mobile device. 

On Apr 2, 2017, at 4:23 PM, Dean Junk <[hidden email]> wrote:

I tried testing the fix and ran into a different problem (I think from an apt-get upgrade). Anyway, I get the header, the footer, and nothing in between that would be from the collections.json. What's the best way to debug this issue? The issue showed up after a reboot and not after the patch (which is why I think an update from apt-get caused the issue).

Thanks!

On 3/31/17 5:02 AM, Dean Junk wrote:
Thanks! I will test it out this weekend.

On 3/30/17 6:45 PM, H Plato wrote:
I dug into the issue and put a fix on my github ia7 branch if you want to test it out. Seems to work properly, but I haven’t tested everything yet.


On Mar 12, 2017, at 6:41 PM, Dean Junk <[hidden email]> wrote:

Yes, that is exactly what I was seeing.

On 3/12/17 7:37 PM, H Plato wrote:
I think I see what you mean. A page like this:


Generates about 6 - 10 requests a second from my server.

So, yes that probably a bug. It’s been this way since the prototype, but definitely this could be looked at to only send data back when the requested data changes. I’m guessing this returns right away on all calls since at least one object in MH meets these conditions all the time:

        if ( !( $object->can('get_idle_time') ) ) {

            #Items that do not have an idle time do not get reported at all in updates
            return;
        }
        elsif ( $object->get_idle_time eq '' ) {

            #Items that have NEVER been set to a state have a null idle time
            return;
        }
        elsif  (( $request_time - 1 ) > ( $current_time - $object->get_idle_time ) )
        {

            #To avoid missed changes, since they can happen at the millisecond level, give a second's cushion
            #Object has not changed since time, so return undefined
            return;
        }

json_server optimization should be on the todo list for 4.3. It would be great to fix this, and to reduce the CPU overhead of the json_server polling.


On Mar 12, 2017, at 3:28 PM, Dean Junk <[hidden email]> wrote:

I think it's a bug since on all other pages you see the long poll executed every so often if you let the page be idle, but on these pages you can barely read a line on the network tab since long poll is being called so often.
 
On 3/12/17 3:58 PM, [hidden email] wrote:
Probably a feature. That’s how the ‘IA7 Server push' design works, a long_poll is generated which keeps the connection open until new data arrives, or the connection times out. The javascript on the page processes the data, and then calls it again.

It could be a ‘bug’, since the downside of this approach causes more CPU cycles for the MH process as json_server constantly checks if new data is available to push to the client.


On Mar 12, 2017, at 12:24 PM, Dean Junk <[hidden email]> wrote:

While trying to debug my reverse proxy with ssl to misterhouse, I noticed in the developer console under network, LONG_POLL is called repeatedly on the browse items and categories pages. The only way to make it stop is to browse off of those pages. At first I thought it might be my reverse proxy setup, but I also saw the same behavior when accessing misterhouse directly using normal http. The pages are displayed immediately, but the call to LONG_POLL seems infinite.

Bug or feature?

Thanks!
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users











------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users

Reply | Threaded
Open this post in threaded view
|

Re: LONG_POLL when clicking on browse items & categories

H Plato
Do you see the same results from multiple browsers? Do you have an extension like noScript running? Can you clear the browser cache and reload?

Normally the lack of any collections buttons means either; the javascript encountered an error (which would show in the javascript console), or the collections.json couldn’t be parsed (which would show in the print_log). Since you have neither, I’m wondering if it might be a browser issue?


On Apr 2, 2017, at 7:36 PM, Dean Junk <[hidden email]> wrote:

Just to be safe, I downloaded stable to a new directory, created new code and data directories and updated my private.ini to point to the new directories. Same result:

get the header that has "Misterhouse a button with checking as the label and settings button"
a grey thin bar where the main misterhouse buttons should be
a footer with a daily quote
another line in the footer with machine usage stats.

The terminal on startup shows:

Command: mh
Pgm  path   : /home/mrhouse/mh_4.2/bin
Pgm  version: 4.2 
Last updated: Sun Apr  2 20:16:15 2017
Perl version: 5.022001
OS   version: linux linux 
Other       : user=mrhouse pid=22826 box= cpu=-

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

Read parameter files: ./mh.ini ./mh.private.ini /home/mrhouse/code/mh.private.ini
Debugging for insteon turned on
Debugging for x10 turned on
Debugging for w800 turned on
Code Directories:
 - /home/mrhouse/code2/
 - ./../code/common
Loading other modules
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\$::Weather{ <-- HERE (.*?)}/ at /home/mrhouse/mh_4.2/bin/../lib/Weather_Item.pm line 96.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/-\>{ <-- HERE state}=(.*);/ at /home/mrhouse/mh_4.2/bin/../lib/Light_Item.pm line 992.
Starting setup
 - using simple Text distance function
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/'}{ <-- HERE '/ at /home/mrhouse/mh_4.2/bin/../lib/json_server.pl line 819.
 - reading previous log files
tail function error, could not open /home/mrhouse/data2//logs/print.log: No such file or directory
tail function error, could not open /home/mrhouse/data2//logs/speak.log: No such file or directory
tail function error, could not open /home/mrhouse/data2//logs/error.log: No such file or directory
 - archiving previous /home/mrhouse/data2//logs/*.log files .Warning, could not open file_cat /home/mrhouse/data2//logs/error.log: No such file or directory
.Warning, could not open file_cat /home/mrhouse/data2//logs/print.log: No such file or directory
.Warning, could not open file_cat /home/mrhouse/data2//logs/speak.log: No such file or directory
.
 - creating http            on tcp   8082 buffered
 - creating server mhsend   on tcp   8084 buffered
 - creating server telnet   on tcp   1234 raw
 - creating xap_send        on udp  3639 send
 - creating xap_listen_core on udp 49152 listen
 - creating xpl_send        on udp  3865 send
 - creating xpl_listen      on udp 49352 listen
 - initializing state tracker ...
 - creating W800 port on /dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0
02/04/2017 08:23:32 PM [Insteon_PLM] serial:/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A600B3FN-if00-port0:19200
 - creating Insteon PLM port on /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A600B3FN-if00-port0
 - object logging disabled
 - process id 22826 written to /home/mrhouse/data2//mh.pid
 - external command file (xcmd_file): ./../house_cmd.txt
 - HTML file     : ./../web/ia5/index.shtml

Warning:  password_file /home/mrhouse/data2//.password not found.  Run mh/bin/set_password

Done with setup

02/04/2017 08:23:32 PM [IA7_Collection_Updater] : Starting
02/04/2017 08:23:32 PM [IA7_Collection_Updater] : Reviewing ./../data/web/collections.json to current version 1.2
02/04/2017 08:23:32 PM [IA7_Collection_Updater] : Finished
02/04/2017 08:23:32 PM Perl @INC contains: /home/mrhouse/code2/, ./../code/common, /home/mrhouse/mh_4.2/bin/../lib, /home/mrhouse/mh_4.2/bin/../lib/site, ., /etc/perl, /usr/local/lib/x86_64-linux-gnu/perl/5.22.1, /usr/local/share/perl/5.22.1, /usr/lib/x86_64-linux-gnu/perl5/5.22, /usr/share/perl5, /usr/lib/x86_64-linux-gnu/perl/5.22, /usr/share/perl/5.22, /usr/local/lib/site_perl, /usr/lib/x86_64-linux-gnu/perl-base, .
02/04/2017 08:23:32 PM Reading /home/mrhouse/code/mh.private.ini and mh.ini
   html_alias alias /photos_big dir does not exist, dir=$config_parms{data_dir}/photos
   html_alias alias /photos dir does not exist, dir=/home/mrhouse/data2//photos
   html_alias alias /email dir does not exist, dir=/home/mrhouse/data2//email
   html_alias alias /tv dir does not exist, dir=/home/mrhouse/data2//tv
   html_alias alias /rrd dir does not exist, dir=/home/mrhouse/data2//rrd
Voice names: Microsoft Mary, Microsoft Mike, Microsoft Sam
Read 4 entries from ./../data/pronouncable_words.list

Error, could not find the caller id file /home/mrhouse/data2//phone/phone.caller_id.list: No such file or directory
Reading code_dirs: /home/mrhouse/code2/ ./../code/common
02/04/2017 08:23:32 PM Reading 13 code files
02/04/2017 08:23:32 PM Evaluating user code

Good code saved
02/04/2017 08:23:32 PM FUNCTION: set_volume_pre_hook
02/04/2017 08:23:32 PM running: play ./../sounds/sound_click1.wav

Restoring object states
Object states restored
Activating voice commands
Starting monitor commands loop

Latitude: 41.726788,  Longitude: -93.604283,  Time Zone: -6
sunrise=6:56 AM sunset=7:41 PM
sunrise twilight=6:28 AM sunset twilight=8:09 PM
The moon is Half Waxing, 39% bright, and 6 days old
The next full moon is on Wednesday, May 10th

./../sounds/sound_click1.wav:

 File Size: 908       Bit Rate: 186k
  Encoding: Unsigned PCM 
  Channels: 1 @ 8-bit   
Samplerate: 22050Hz     
Replaygain: off        
  Duration: 00:00:00.04 

In:100%  00:00:00.04 [00:00:00.00] Out:1.87k [!=====|=====!]        Clip:26  
play WARN rate: rate clipped 14 samples; decrease volume?
play WARN dither: dither clipped 12 samples; decrease volume?
Done.
02/04/2017 08:23:33 PM Rereading .menu code files.
02/04/2017 08:23:33 PM Organizer: Calendar matches target schema and does not require upgrading
02/04/2017 08:23:33 PM Organizer: Todo matches target schema and does not require upgrading
02/04/2017 08:23:33 PM Organizer: Reading updated organizer calendar file now
setting $organizer_vacation
setting $organizer_holidays
setting $organizer_events
02/04/2017 08:23:33 PM Evaluating code organizer_events
02/04/2017 08:23:33 PM Organizer: Reading updated organizer todo file
Bad time format:  12:00 am + 23:59   caller=main /home/mrhouse/mh_4.2/bin/mh 7407
db mday=2 mdayf=4 min=23 minf=00 secf=0 hour=20 hourf=12 ap=AM m=4 mf=14 y=2017 yf=137
02/04/2017 08:23:33 PM Evaluating code organizer_tasks


The Print log shows:

02/04/2017 08:23:32 PM ---------- Restart ----------
02/04/2017 08:23:32 PM [Insteon_PLM] serial:/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A600B3FN-if00-port0:19200
02/04/2017 08:23:32 PM [IA7_Collection_Updater] : Starting
02/04/2017 08:23:32 PM [IA7_Collection_Updater] : Reviewing ./../data/web/collections.json to current version 1.2
02/04/2017 08:23:32 PM [IA7_Collection_Updater] : Finished
02/04/2017 08:23:32 PM Perl @INC contains: /home/mrhouse/code2/, ./../code/common, /home/mrhouse/mh_4.2/bin/../lib, /home/mrhouse/mh_4.2/bin/../lib/site, ., /etc/perl, /usr/local/lib/x86_64-linux-gnu/perl/5.22.1, /usr/local/share/perl/5.22.1, /usr/lib/x86_64-linux-gnu/perl5/5.22, /usr/share/perl5, /usr/lib/x86_64-linux-gnu/perl/5.22, /usr/share/perl/5.22, /usr/local/lib/site_perl, /usr/lib/x86_64-linux-gnu/perl-base, .
02/04/2017 08:23:32 PM Reading /home/mrhouse/code/mh.private.ini and mh.ini
02/04/2017 08:23:32 PM Reading 13 code files
02/04/2017 08:23:32 PM Evaluating user code
02/04/2017 08:23:32 PM FUNCTION: set_volume_pre_hook
02/04/2017 08:23:32 PM running: play ./../sounds/sound_click1.wav
02/04/2017 08:23:33 PM Rereading .menu code files.
02/04/2017 08:23:33 PM Organizer: Calendar matches target schema and does not require upgrading
02/04/2017 08:23:33 PM Organizer: Todo matches target schema and does not require upgrading
02/04/2017 08:23:33 PM Organizer: Reading updated organizer calendar file now
02/04/2017 08:23:33 PM Evaluating code organizer_events
02/04/2017 08:23:33 PM Organizer: Reading updated organizer todo file
02/04/2017 08:23:33 PM Evaluating code organizer_tasks

Can I run something from command line that would produce the html for the objects in the collections.json to try and debug?

Any help would be greatly appreciated!

Thanks!

On 4/2/17 7:36 PM, H Plato wrote:

I don’t think this isn’t part of the IA7 code I added, so I’m not sure what to suggest.


On Apr 2, 2017, at 5:28 PM, Dean Junk <[hidden email]> wrote:

The only thing that shows up in the console is:
failed_request.shtml:1 Uncaught SyntaxError: Unexpected token <

Print.log shows:
Unrecognized html request: get_req=/javascript/jquery/jquery.csvToTable.js get_arg=  header=GET /javascript/jquery/jquery.csvToTable.js HTTP/1.1

On 4/2/17 5:53 PM, H Plato wrote:
The javascript console is the best way. If you have chrome, right click on something, inspect element, select console and then reload the page. 

You can also look in the mh print log, if there is a problem with your collections.json file, there will be some information. 

Sent from my mobile device. 

On Apr 2, 2017, at 4:23 PM, Dean Junk <[hidden email]> wrote:

I tried testing the fix and ran into a different problem (I think from an apt-get upgrade). Anyway, I get the header, the footer, and nothing in between that would be from the collections.json. What's the best way to debug this issue? The issue showed up after a reboot and not after the patch (which is why I think an update from apt-get caused the issue).

Thanks!

On 3/31/17 5:02 AM, Dean Junk wrote:
Thanks! I will test it out this weekend.

On 3/30/17 6:45 PM, H Plato wrote:
I dug into the issue and put a fix on my github ia7 branch if you want to test it out. Seems to work properly, but I haven’t tested everything yet.


On Mar 12, 2017, at 6:41 PM, Dean Junk <[hidden email]> wrote:

Yes, that is exactly what I was seeing.

On 3/12/17 7:37 PM, H Plato wrote:
I think I see what you mean. A page like this:


Generates about 6 - 10 requests a second from my server.

So, yes that probably a bug. It’s been this way since the prototype, but definitely this could be looked at to only send data back when the requested data changes. I’m guessing this returns right away on all calls since at least one object in MH meets these conditions all the time:

        if ( !( $object->can('get_idle_time') ) ) {

            #Items that do not have an idle time do not get reported at all in updates
            return;
        }
        elsif ( $object->get_idle_time eq '' ) {

            #Items that have NEVER been set to a state have a null idle time
            return;
        }
        elsif  (( $request_time - 1 ) > ( $current_time - $object->get_idle_time ) )
        {

            #To avoid missed changes, since they can happen at the millisecond level, give a second's cushion
            #Object has not changed since time, so return undefined
            return;
        }

json_server optimization should be on the todo list for 4.3. It would be great to fix this, and to reduce the CPU overhead of the json_server polling.


On Mar 12, 2017, at 3:28 PM, Dean Junk <[hidden email]> wrote:

I think it's a bug since on all other pages you see the long poll executed every so often if you let the page be idle, but on these pages you can barely read a line on the network tab since long poll is being called so often.
 
On 3/12/17 3:58 PM, [hidden email] wrote:
Probably a feature. That’s how the ‘IA7 Server push' design works, a long_poll is generated which keeps the connection open until new data arrives, or the connection times out. The javascript on the page processes the data, and then calls it again.

It could be a ‘bug’, since the downside of this approach causes more CPU cycles for the MH process as json_server constantly checks if new data is available to push to the client.


On Mar 12, 2017, at 12:24 PM, Dean Junk <[hidden email]> wrote:

While trying to debug my reverse proxy with ssl to misterhouse, I noticed in the developer console under network, LONG_POLL is called repeatedly on the browse items and categories pages. The only way to make it stop is to browse off of those pages. At first I thought it might be my reverse proxy setup, but I also saw the same behavior when accessing misterhouse directly using normal http. The pages are displayed immediately, but the call to LONG_POLL seems infinite.

Bug or feature?

Thanks!
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users












------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users

Reply | Threaded
Open this post in threaded view
|

Re: LONG_POLL when clicking on browse items & categories

Dean Junk
Geez, that worked! I first tried a different browser and when that worked I cleared my cache on Chrome and that worked as well.

THANK YOU!!!

On 4/2/17 8:57 PM, H Plato wrote:
Do you see the same results from multiple browsers? Do you have an extension like noScript running? Can you clear the browser cache and reload?

Normally the lack of any collections buttons means either; the javascript encountered an error (which would show in the javascript console), or the collections.json couldn’t be parsed (which would show in the print_log). Since you have neither, I’m wondering if it might be a browser issue?


On Apr 2, 2017, at 7:36 PM, Dean Junk <[hidden email]> wrote:

Just to be safe, I downloaded stable to a new directory, created new code and data directories and updated my private.ini to point to the new directories. Same result:

get the header that has "Misterhouse a button with checking as the label and settings button"
a grey thin bar where the main misterhouse buttons should be
a footer with a daily quote
another line in the footer with machine usage stats.

The terminal on startup shows:

Command: mh
Pgm  path   : /home/mrhouse/mh_4.2/bin
Pgm  version: 4.2 
Last updated: Sun Apr  2 20:16:15 2017
Perl version: 5.022001
OS   version: linux linux 
Other       : user=mrhouse pid=22826 box= cpu=-

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

Read parameter files: ./mh.ini ./mh.private.ini /home/mrhouse/code/mh.private.ini
Debugging for insteon turned on
Debugging for x10 turned on
Debugging for w800 turned on
Code Directories:
 - /home/mrhouse/code2/
 - ./../code/common
Loading other modules
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\$::Weather{ <-- HERE (.*?)}/ at /home/mrhouse/mh_4.2/bin/../lib/Weather_Item.pm line 96.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/-\>{ <-- HERE state}=(.*);/ at /home/mrhouse/mh_4.2/bin/../lib/Light_Item.pm line 992.
Starting setup
 - using simple Text distance function
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/'}{ <-- HERE '/ at /home/mrhouse/mh_4.2/bin/../lib/json_server.pl line 819.
 - reading previous log files
tail function error, could not open /home/mrhouse/data2//logs/print.log: No such file or directory
tail function error, could not open /home/mrhouse/data2//logs/speak.log: No such file or directory
tail function error, could not open /home/mrhouse/data2//logs/error.log: No such file or directory
 - archiving previous /home/mrhouse/data2//logs/*.log files .Warning, could not open file_cat /home/mrhouse/data2//logs/error.log: No such file or directory
.Warning, could not open file_cat /home/mrhouse/data2//logs/print.log: No such file or directory
.Warning, could not open file_cat /home/mrhouse/data2//logs/speak.log: No such file or directory
.
 - creating http            on tcp   8082 buffered
 - creating server mhsend   on tcp   8084 buffered
 - creating server telnet   on tcp   1234 raw
 - creating xap_send        on udp  3639 send
 - creating xap_listen_core on udp 49152 listen
 - creating xpl_send        on udp  3865 send
 - creating xpl_listen      on udp 49352 listen
 - initializing state tracker ...
 - creating W800 port on /dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0
02/04/2017 08:23:32 PM [Insteon_PLM] serial:/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A600B3FN-if00-port0:19200
 - creating Insteon PLM port on /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A600B3FN-if00-port0
 - object logging disabled
 - process id 22826 written to /home/mrhouse/data2//mh.pid
 - external command file (xcmd_file): ./../house_cmd.txt
 - HTML file     : ./../web/ia5/index.shtml

Warning:  password_file /home/mrhouse/data2//.password not found.  Run mh/bin/set_password

Done with setup

02/04/2017 08:23:32 PM [IA7_Collection_Updater] : Starting
02/04/2017 08:23:32 PM [IA7_Collection_Updater] : Reviewing ./../data/web/collections.json to current version 1.2
02/04/2017 08:23:32 PM [IA7_Collection_Updater] : Finished
02/04/2017 08:23:32 PM Perl @INC contains: /home/mrhouse/code2/, ./../code/common, /home/mrhouse/mh_4.2/bin/../lib, /home/mrhouse/mh_4.2/bin/../lib/site, ., /etc/perl, /usr/local/lib/x86_64-linux-gnu/perl/5.22.1, /usr/local/share/perl/5.22.1, /usr/lib/x86_64-linux-gnu/perl5/5.22, /usr/share/perl5, /usr/lib/x86_64-linux-gnu/perl/5.22, /usr/share/perl/5.22, /usr/local/lib/site_perl, /usr/lib/x86_64-linux-gnu/perl-base, .
02/04/2017 08:23:32 PM Reading /home/mrhouse/code/mh.private.ini and mh.ini
   html_alias alias /photos_big dir does not exist, dir=$config_parms{data_dir}/photos
   html_alias alias /photos dir does not exist, dir=/home/mrhouse/data2//photos
   html_alias alias /email dir does not exist, dir=/home/mrhouse/data2//email
   html_alias alias /tv dir does not exist, dir=/home/mrhouse/data2//tv
   html_alias alias /rrd dir does not exist, dir=/home/mrhouse/data2//rrd
Voice names: Microsoft Mary, Microsoft Mike, Microsoft Sam
Read 4 entries from ./../data/pronouncable_words.list

Error, could not find the caller id file /home/mrhouse/data2//phone/phone.caller_id.list: No such file or directory
Reading code_dirs: /home/mrhouse/code2/ ./../code/common
02/04/2017 08:23:32 PM Reading 13 code files
02/04/2017 08:23:32 PM Evaluating user code

Good code saved
02/04/2017 08:23:32 PM FUNCTION: set_volume_pre_hook
02/04/2017 08:23:32 PM running: play ./../sounds/sound_click1.wav

Restoring object states
Object states restored
Activating voice commands
Starting monitor commands loop

Latitude: 41.726788,  Longitude: -93.604283,  Time Zone: -6
sunrise=6:56 AM sunset=7:41 PM
sunrise twilight=6:28 AM sunset twilight=8:09 PM
The moon is Half Waxing, 39% bright, and 6 days old
The next full moon is on Wednesday, May 10th

./../sounds/sound_click1.wav:

 File Size: 908       Bit Rate: 186k
  Encoding: Unsigned PCM 
  Channels: 1 @ 8-bit   
Samplerate: 22050Hz     
Replaygain: off        
  Duration: 00:00:00.04 

In:100%  00:00:00.04 [00:00:00.00] Out:1.87k [!=====|=====!]        Clip:26  
play WARN rate: rate clipped 14 samples; decrease volume?
play WARN dither: dither clipped 12 samples; decrease volume?
Done.
02/04/2017 08:23:33 PM Rereading .menu code files.
02/04/2017 08:23:33 PM Organizer: Calendar matches target schema and does not require upgrading
02/04/2017 08:23:33 PM Organizer: Todo matches target schema and does not require upgrading
02/04/2017 08:23:33 PM Organizer: Reading updated organizer calendar file now
setting $organizer_vacation
setting $organizer_holidays
setting $organizer_events
02/04/2017 08:23:33 PM Evaluating code organizer_events
02/04/2017 08:23:33 PM Organizer: Reading updated organizer todo file
Bad time format:  12:00 am + 23:59   caller=main /home/mrhouse/mh_4.2/bin/mh 7407
db mday=2 mdayf=4 min=23 minf=00 secf=0 hour=20 hourf=12 ap=AM m=4 mf=14 y=2017 yf=137
02/04/2017 08:23:33 PM Evaluating code organizer_tasks


The Print log shows:

02/04/2017 08:23:32 PM ---------- Restart ----------
02/04/2017 08:23:32 PM [Insteon_PLM] serial:/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A600B3FN-if00-port0:19200
02/04/2017 08:23:32 PM [IA7_Collection_Updater] : Starting
02/04/2017 08:23:32 PM [IA7_Collection_Updater] : Reviewing ./../data/web/collections.json to current version 1.2
02/04/2017 08:23:32 PM [IA7_Collection_Updater] : Finished
02/04/2017 08:23:32 PM Perl @INC contains: /home/mrhouse/code2/, ./../code/common, /home/mrhouse/mh_4.2/bin/../lib, /home/mrhouse/mh_4.2/bin/../lib/site, ., /etc/perl, /usr/local/lib/x86_64-linux-gnu/perl/5.22.1, /usr/local/share/perl/5.22.1, /usr/lib/x86_64-linux-gnu/perl5/5.22, /usr/share/perl5, /usr/lib/x86_64-linux-gnu/perl/5.22, /usr/share/perl/5.22, /usr/local/lib/site_perl, /usr/lib/x86_64-linux-gnu/perl-base, .
02/04/2017 08:23:32 PM Reading /home/mrhouse/code/mh.private.ini and mh.ini
02/04/2017 08:23:32 PM Reading 13 code files
02/04/2017 08:23:32 PM Evaluating user code
02/04/2017 08:23:32 PM FUNCTION: set_volume_pre_hook
02/04/2017 08:23:32 PM running: play ./../sounds/sound_click1.wav
02/04/2017 08:23:33 PM Rereading .menu code files.
02/04/2017 08:23:33 PM Organizer: Calendar matches target schema and does not require upgrading
02/04/2017 08:23:33 PM Organizer: Todo matches target schema and does not require upgrading
02/04/2017 08:23:33 PM Organizer: Reading updated organizer calendar file now
02/04/2017 08:23:33 PM Evaluating code organizer_events
02/04/2017 08:23:33 PM Organizer: Reading updated organizer todo file
02/04/2017 08:23:33 PM Evaluating code organizer_tasks

Can I run something from command line that would produce the html for the objects in the collections.json to try and debug?

Any help would be greatly appreciated!

Thanks!

On 4/2/17 7:36 PM, H Plato wrote:

I don’t think this isn’t part of the IA7 code I added, so I’m not sure what to suggest.


On Apr 2, 2017, at 5:28 PM, Dean Junk <[hidden email]> wrote:

The only thing that shows up in the console is:
failed_request.shtml:1 Uncaught SyntaxError: Unexpected token <

Print.log shows:
Unrecognized html request: get_req=/javascript/jquery/jquery.csvToTable.js get_arg=  header=GET /javascript/jquery/jquery.csvToTable.js HTTP/1.1

On 4/2/17 5:53 PM, H Plato wrote:
The javascript console is the best way. If you have chrome, right click on something, inspect element, select console and then reload the page. 

You can also look in the mh print log, if there is a problem with your collections.json file, there will be some information. 

Sent from my mobile device. 

On Apr 2, 2017, at 4:23 PM, Dean Junk <[hidden email]> wrote:

I tried testing the fix and ran into a different problem (I think from an apt-get upgrade). Anyway, I get the header, the footer, and nothing in between that would be from the collections.json. What's the best way to debug this issue? The issue showed up after a reboot and not after the patch (which is why I think an update from apt-get caused the issue).

Thanks!

On 3/31/17 5:02 AM, Dean Junk wrote:
Thanks! I will test it out this weekend.

On 3/30/17 6:45 PM, H Plato wrote:
I dug into the issue and put a fix on my github ia7 branch if you want to test it out. Seems to work properly, but I haven’t tested everything yet.


On Mar 12, 2017, at 6:41 PM, Dean Junk <[hidden email]> wrote:

Yes, that is exactly what I was seeing.

On 3/12/17 7:37 PM, H Plato wrote:
I think I see what you mean. A page like this:


Generates about 6 - 10 requests a second from my server.

So, yes that probably a bug. It’s been this way since the prototype, but definitely this could be looked at to only send data back when the requested data changes. I’m guessing this returns right away on all calls since at least one object in MH meets these conditions all the time:

        if ( !( $object->can('get_idle_time') ) ) {

            #Items that do not have an idle time do not get reported at all in updates
            return;
        }
        elsif ( $object->get_idle_time eq '' ) {

            #Items that have NEVER been set to a state have a null idle time
            return;
        }
        elsif  (( $request_time - 1 ) > ( $current_time - $object->get_idle_time ) )
        {

            #To avoid missed changes, since they can happen at the millisecond level, give a second's cushion
            #Object has not changed since time, so return undefined
            return;
        }

json_server optimization should be on the todo list for 4.3. It would be great to fix this, and to reduce the CPU overhead of the json_server polling.


On Mar 12, 2017, at 3:28 PM, Dean Junk <[hidden email]> wrote:

I think it's a bug since on all other pages you see the long poll executed every so often if you let the page be idle, but on these pages you can barely read a line on the network tab since long poll is being called so often.
 
On 3/12/17 3:58 PM, [hidden email] wrote:
Probably a feature. That’s how the ‘IA7 Server push' design works, a long_poll is generated which keeps the connection open until new data arrives, or the connection times out. The javascript on the page processes the data, and then calls it again.

It could be a ‘bug’, since the downside of this approach causes more CPU cycles for the MH process as json_server constantly checks if new data is available to push to the client.


On Mar 12, 2017, at 12:24 PM, Dean Junk <[hidden email]> wrote:

While trying to debug my reverse proxy with ssl to misterhouse, I noticed in the developer console under network, LONG_POLL is called repeatedly on the browse items and categories pages. The only way to make it stop is to browse off of those pages. At first I thought it might be my reverse proxy setup, but I also saw the same behavior when accessing misterhouse directly using normal http. The pages are displayed immediately, but the call to LONG_POLL seems infinite.

Bug or feature?

Thanks!
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users













------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users