Skip to content

WOPI editor: activity inside the editor doesn't count for auto_logout #219

Open

Description

@moodyjmz

The WOPI editor page looks like it doesn't report editor activity to core's auto_logout, so users who edit without touching the Nextcloud page around the iframe would be logged out after session_lifetime. Fix: poll Get_User_State and update lastActive, as richdocuments does; this should work with Collabora now and with Euro-Office once Euro-Office/web-apps#384 lands.

Details

Cause

Core tracks activity with listeners on the page's own window (session-heartbeat.ts#L143-L150). Input inside the editor iframe doesn't reach them. The WOPI host's message handler in #8 (src/views/Editor.vue#L34-L69) handles App_LoadingStatus and UI_Close only.

The same gap was measured in the Euro-Office connector app: a user who types and clicks in the editor non-stop was logged out after session_lifetime (NC 34.0.5, session_lifetime=120: GET /logout?requesttoken=… after 119.2 s, with 0 input events reaching the NC page). The WOPI path hasn't been measured, but it has no reporting code either.

Fix

Core's hook for embedded editors is a storage event for lastActive dispatched on the host window (session-heartbeat.ts#L152-L162). richdocuments' autoLogout.js appears to do the whole job and looks portable:

  • every 10 s, post Get_User_State to the editor; on Get_User_State_Resp with Elapsed < 30, write lastActive and dispatch the storage event;
  • only when auto_logout is on or session_keepalive is off;
  • with session_keepalive off, also extend the server session on activity (richdocuments calls its own /heartbeat route);
  • remove the interval and handler in onUnmounted.

Get_User_State is a Collabora message, not part of the WOPI spec. Euro-Office doesn't answer it yet: Euro-Office/web-apps#384.

Activity

  1. added
    integrationCompatibility with other apps/systems
    bugSomething isn't working
    and removed on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingintegrationCompatibility with other apps/systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions