Repository navigation
Conversation
7 tasks
When the device was online but the server could not be reached, the app showed no hint at all, and only the conversation list knew about the maintenance mode. Requests just failed silently. The outcome of every request now feeds one central connection status per server, and every screen shows it in the same banner above its content, for XML and Compose screens alike. While the server can't be used, it is checked again periodically so the banner also disappears on screens that send no requests themselves. The separate banner of the conversation list and the offline hint of the chat input are replaced by the central banner, so the warning is not shown twice. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
mahibi
force-pushed
the
showServerNotReachableWarning
branch
from
November 23, 2026 11:59
d48639a to
af14ee6
Compare
mahibi
marked this pull request as ready for review
November 23, 2026 12:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the device was online but the Nextcloud server could not be reached (server down, DNS failure, connection refused or timeout, proxy returning 502/504), the app showed no hint at all: requests just failed silently. The maintenance mode was only shown on the conversation list.
This PR adds one central warning panel that is shown on all screens, for XML and Compose screens alike, without code in the individual screens. It builds on the central approach of #6587.
How it works
ServerConnectionInterceptorwatches the outcome of every request to the account's server:X-Nextcloud-Maintenance-Mode: 1means maintenance modeServerConnectionMonitorkeeps that status per server. While the server can't be used, and whenever the device connectivity changes, it checks the server withindex.php/204(the walled garden endpoint the desktop and Files clients use; only an exact 204 counts, so a captive portal page is not taken for the server). So the status also recovers on screens that send no requests.BaseActivityputs every screen's content below aStatusBannerLayout, which shows "No connection to server" or the maintenance mode text. While the banner is shown, it takes over the status bar inset, so the content below doesn't pad for the status bar twice. Calls, the media viewer and the login screens opt out withshowsStatusBanner = false.Known limitation/ will be improved in a followup PR
While
NetworkMonitorconsiders the device offline, the banner shows "No connection to server" as well, because the app doesn't sync or send then.NetworkMonitorrequires the network to be validated by Android (by default against Google's servers), so on a LAN without internet the banner shows although the server could be reached. This matches the behaviour before this PR. Removing that dependency changes when the whole app syncs and sends, so it is left for a separate PR (it will address #6240).How to test
occ maintenance:mode --on/--off: the maintenance banner appears and disappears.🏁 Checklist
/backport to stable-xx.x🤖 AI (if applicable)