Skip to content

fix(auto-logout): Send heartbeats while editing instead of while idle - #6197

Open
DerDreschner wants to merge 1 commit into
mainfrom
fix/change-auto-logout-handling
Open

DerDreschner wants to merge 1 commit into
mainfrom
fix/change-auto-logout-handling

Conversation

@DerDreschner

Copy link
Copy Markdown

Summary

The initial implementation from #3224 contained a bug: With session_keepalive disabled, the heartbeat was only sent when the stored last activity was older then half the session lifetime. While the user kept editing, the activity was refreshed every 10 seconds, so no heartbeat was sent and the session expired mid-edit. Once idle, a heartbeat was sent on every check and kept the session alive.

This is being fixed with this PR by sending at most one heartbeat per interval and only for interactions Collabora reported since the last one. The handler is also unregistered when the document is closed, so closed documents stop sending heartbeats.

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Documentation (manuals or wiki) has been updated or is not required

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@DerDreschner

Copy link
Copy Markdown
Author

Failed static analysis is unrelated to my changes.

This comment was marked as outdated.

With `session_keepalive` disabled, the heartbeat was only sent when the stored last activity was older then half the session lifetime. While the user kept editing, the activity was refreshed every 10 seconds, so no heartbeat was sent and the session expired mid-edit. Once idle, a heartbeat was sent on every check and kept the session alive.

Send at most one heartbeat per interval, and only for interactions Collabora reported since the last one. Unregister the handler when the document is closed, so closed documents stop sending heartbeats, and keep reporting the activity to core when the browser storage is not available.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: David Dreschner <david.dreschner@nextcloud.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃煝 Approval recommended

The focused changes address the reported timeout behavior with no unresolved findings.

0 open findings

1 resolved since last review

馃 Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants