vaadin / vaadin/framework

Websocket timeout causes page refresh

Open
#11,595 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.8k
Forks
717
Avg merge
2d 6h
Merged PRs (30d)
3

Description

- Vaadin Framework version
Tested on 8.x but probably any

- Browser version:
any

- Description of the bug
some parameter of atmosphere is by default set to servlet sessionTimeout.
Due to heartbeat calls the server session never timeouts. Fine.
But in case of client inactivity, the client side atmosphere thinks it expired and then refreshes the page.

https://github.com/Atmosphere/atmosphere/blob/4a84ea43365c3f236b41608e16b2d6822f48bc04/modules/cpr/src/main/java/org/atmosphere/cpr/ApplicationConfig.java

Maybe:

    /**
     * The default {@link javax.servlet.http.HttpSession#setMaxInactiveInterval(int)}
     * <p/>
     * Default: -1<br>
     * Value: org.atmosphere.cpr.session.maxInactiveInterval
     */
    String SESSION_MAX_INACTIVE_INTERVAL = "org.atmosphere.cpr.session.maxInactiveInterval";

But could be due to org.atmosphere.websocket.maxIdleTime.

- Minimal reproducible example
set session timeout to 1min and heartbeat to 30s.
wait >1min ensuring no websocket frame is transfered.

- Expected behavior
no page refresh

- Solution
Ensure atmosphere never detects inactivity to let vaadin work:
to be tested
rg.atmosphere.websocket.maxIdleTime = -1 or org.atmosphere.cpr.session.maxInactiveInterval = -1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Atmosphere ApplicationConfig.java and reproduce the case with a one-minute session timeout and a 30-second heartbeat, waiting until no WebSocket frame is transferred. Determine whether session.maxInactiveInterval or websocket.maxIdleTime causes the refresh; done means the page does not refresh after client inactivity.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.