Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile client idles after a short timeout. #14803

Closed
hons82 opened this issue Oct 11, 2022 · 20 comments
Closed

Mobile client idles after a short timeout. #14803

hons82 opened this issue Oct 11, 2022 · 20 comments

Comments

@hons82
Copy link

hons82 commented Oct 11, 2022

Description of the bug

We do have some clients that use iPads/iPhones or Android tablets/phones to interact with our Application. Typically for our system is that a user opens a UI and leaves it open for a while (usually by disabling the screen sleep mode, so that it remains always on).
As long as they are actively used the devices remain responsive and quite fast, but when not used they seem to enter in some kind of idle mode, so that on the first click on an action it takes seconds (in our application 5-10sec) and while that happens the blue loading bar appears. After the first request is handled the UI remains responsive for subsequent requests, until it is left alone for something like 15-30 seconds. Then is starts over again.

Currently we have to use long polling as transport for the push because of some external requirements that do not allow us to use websockets so far.

Expected behavior

Ideally those mobile clients should not idle... At least until the screen shuts down. But we'd already be happy if we'd know what does trigger that behavior and ideally configure it to some higher value.

Minimal reproducible example

https://github.com/hons82/vaadin_sampler

You'll need to start it, then go to http://localhost:8080/grid_columns on your mobile device. Click a couple of times on reset columns to get a bunch of columns. Then leave the mobile untouched for a minute and try to remove a column.

Versions

  • Vaadin / Flow version: The minimal is on 14, but we use 23.2 currently
  • Java version: 17
  • OS version: Windows for the Server and iOS/Android on the clients
  • Browser version (if applicable): Mobile Safari and Mobile Chrome
  • Application Server (if applicable):
  • IDE (if applicable): InteliJ
@caalador
Copy link
Contributor

I'm not seeing any extra slow requests using my iPad (iOS 15.6.1), but remove first column sets sorting on everything and on the server I see the exception:

Caused by: java.lang.IllegalArgumentException: Received a sorters changed call from the client for a non-existent column
        at com.vaadin.flow.component.grid.Grid.sortersChanged(Grid.java:3019) ~[vaadin-grid-flow-14.8.19.jar:na]
        at jdk.internal.reflect.GeneratedMethodAccessor70.invoke(Unknown Source) ~[na:na]

I can get a loading bar by going to another app and then when coming back to the browser, but that is most likely due to an os optimization on memory usage.

Are there some other specifics in the setup that might generate the behaviour?

@mshabarov
Copy link
Contributor

Closed, because of no information provides for us to reproduce the issue. Please provide the information and re-open this ticket, if the issue is still valid for you.

@TatuLund
Copy link
Contributor

TatuLund commented Dec 2, 2022

@alexanoid
Copy link

alexanoid commented Dec 2, 2022

I may confirm, I see absolutely the same behavior in my Vaadin app on my iPhone. After some idle time when I try to access the app in the already existing browser tab and click something, I have to wait a few seconds ~5-10 in order to get the page updated. Right after that, UI becomes as fast as usual. I also use LONG_POLLING transport for the @Push. In addition to that, I face the white screen issue as described in my SO question https://stackoverflow.com/questions/74604808/vaadin-23-ui-recreation-after-idle-time

@mshabarov mshabarov reopened this Dec 20, 2022
@mshabarov
Copy link
Contributor

Reopened for further investigation.

@mcollovati
Copy link
Collaborator

I can reproduce the issue with the example project (Vaadin version 14.8.19), but the problem seems not to be present using Vaadin 14.9.4.
@hons82 @alexanoid, can you please try to upgrade to Vaadin 14.9.4, that contains a fix that prevents unnecessary push?

@mshabarov
Copy link
Contributor

@hons82 @alexanoid have you had a chance to try Vaadin 14.9.4 or later version?

@alexanoid
Copy link

@mshabarov I'm on 23.3.5 version. Works good now, thanks! The only issue I have on my iPhone - is that sometimes after some idle time when I restore the browser window with my Vaadin app - I see the white screen. So I have to refresh the entire page in order to get it working again.

@mshabarov
Copy link
Contributor

@alexanoid could you check for any error in the browser console or any other information so we can investigate further?

@alexanoid
Copy link

@mshabarov I don't see the issue since my upgrade to 23.3.6. I'm still monitoring the app.

@mshabarov
Copy link
Contributor

@alexanoid do you have any negative results? Can I close this issue?

@alexanoid
Copy link

Looks like the issue is gone! Thank you!

@hons82
Copy link
Author

hons82 commented Mar 22, 2023

Seems like that's not an issue currently, however we start hearing from clients the problem that @alexanoid describes above, that there is an issue with restoring the connection somehow... Might be related to this, but I do not have enough information right now to reproduce it

@alexanoid
Copy link

Very likely this issue relates to this one #16046 Very often I see the following - let's say I have an open application, then I redeploy it on my server.. and from time to time the application unable to reload itself and I have to refresh the page manually. This is only related to pages where I use HasUrlParameter.setParameter() Looke like the page is failing on the second redundant call of the HasUrlParameter.setParameter() method..

@mcollovati
Copy link
Collaborator

@alexanoid @hons82 the mentioned issue #16046 has been released in Vaadin 24.1.0.alpha3. Can you please check if that version solves also this issue?

@alexanoid
Copy link

@mcollovati I'm on Vaadin 24.1.0.alpha3 - #16046 works good! But this issue I mentioned previously "redeploy it on my server.. and from time to time the application unable to reload itself and I have to refresh the page manually" is unfortunately still present

@mshabarov
Copy link
Contributor

@alexanoid is this the one you are talking about #16664 ? (problems on redeployment). I propose to continue discussing in the other issue more relevant to a problem you have, and close this issue as it seems it was solved in a latest versions.

@alexanoid
Copy link

alexanoid commented Jun 13, 2023

@mshabarov Sure! I'm currently on version 24.1.0, and the application is working much more stable now. Thank you! However, I did notice that occasionally (rarely) the PUSH functionality stops working after a resync. Yes, it was mentioned there #16664 I will continue monitoring the application on version 24.1.0. If I notice the issue occurring frequently, I will report it there.

@mshabarov
Copy link
Contributor

Thanks! Let's use #16664 for monitoring and further discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants