Skip to content

fix: handle an ended guest session when opening or saving a file in an app - #4088

Draft
kulmann wants to merge 1 commit into
mainfrom
fix/app-guest-session-errors
Draft

kulmann wants to merge 1 commit into
mainfrom
fix/app-guest-session-errors

Conversation

@kulmann

@kulmann kulmann commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Description

When a guest's session ended or their access to a share was removed while they had a file open in an app, the app treated it as a plain error:

  • Opening a file showed a bare "Unknown error" page with no way back. Now a 401 while loading the file or its content is handed to the auth error handling, so a guest is sent to the renew page. A signed-in user whose token gets renewed has the file loaded once more, otherwise the error screen shows.
  • Saving answered a guest with "You're not authorized to save this file". A guest now gets "Your access to this file has ended, so it cannot be saved. Copy your changes before you leave this page." and keeps the editor content.
  • A 401 while downloading the file content wasn't recognised as an ended guest session, because getFileContents wraps the error into a plain HttpError. It now is.

Note for extension developers: HttpError.response in @opencloud-eu/web-client is now typed Response | AxiosResponse (it already held an AxiosResponse at runtime for getFileContents). Code reading fetch-only members such as .url or .json() needs to narrow the type first. DavHttpError.response stays Response.

How Has This Been Tested?

  • test environment: unit tests (Vitest), not tested in a browser against a backend yet
  • test case 1: AppWrapper: a 401 while loading the file, its content or a graph request is handed to the auth error handling; navigating away loads nothing more; one retry after a renewed user token; error screen when the page stays or loading fails again
  • test case 2: AppWrapper: guest, user and public link messages for a 401 on save
  • test case 3: guestSessionManager: a 401 wrapped into an HttpError counts as an ended guest session for guest endpoints only
  • test case 4: authService: handleAuthError resolves only after the access denied navigation
  • test case 5: messages store: the request id is logged for fetch, axios and plain-object headers

@kulmann kulmann self-assigned this Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant