-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Text editor loses connection when app sent to background then Reconnect fails #12138
Comments
Reproduced on a Pixel 7 (Android 13). Thanks for the report, @qole.
I'm not sure much can be done about preventing the loss of the connection when moved to the background, but the Reconnect button being partly obscured and reconnect not functioning are definitely bugs. Likely Text app (https://github.com/nextcloud/text) matters, but there may also be something going on in the Android client that brings one or the other out. |
I think both bugs are symptoms of the same problem, the text editor can't reconnect on being re-foregrounded. I suspect the developers didn't intend the "Reconnect" button to appear at all, it should simply reconnect silently, and only escalate to a reconnect button when it can't connect. I suspect some essential connection info (credentials? certificate?) is being lost when the app is backgrounded. It might be relying on a cache that is not maintained when backgrounded? I'm speculating... |
Hmm. Might be related to #11800. |
I have the same issue, opening any .md file within the Nextcloud Andoid app results in this error if it is sent to the background and then opened again a short while later. Same issue happens in the Notes app but only if the rich editing mode is enabled. If the simple editing mode is enabled when the app is sent to the background, no conneciton issue arises. This issue has not been experienced with the desktop browser. Only current solution I have found is to back out from editing the file and then open it again, this works in both the Nextcloud Android and Notes app. Android: 12 |
Maybe fixed by nextcloud/text#5126 ? |
I just installed the Android development version (20240202) and the bug is still present. It says that text#5126 has been merged so I assume that it's in this build? Is there a better way to test it? |
@qole The direct editor is a server-side component so it'll be dependent on Server version and Text app version. |
I'm on NC 28.0.2 and the issue is not fixed. |
I have the same issue, with NC 28.0.2 but I am afraid the logcat does not help much:
At I am using the latest F-Droid version of the Nextcloud android application by the way. |
Hi, is there any way I can help (given that I am not an android dev nor know the app's code)? I can access my phone (unrooted) through adb, and my nextcloud's server logs. This issue makes it hard to use the Notes app in a reliable way (for ex. when constantly switching from a shopping list in Notes for ex. to a supermarket's app)? Nextcloud dev also has the issue btw. |
I tried reading the server logs when the issue happens and here is what I gathered:
When clicking on the Reconnect button a I then checked with the webview browser directly:
I notice the same behaviour: 2 consecutive BUT a TL;DR:
The I added a
Here are the console logs from within the apps:
|
Maybe related to nextcloud/text#4480? |
Spoke with @juliushaertl about it and here is a sum-up on how to tackle it:
I'll now see how to properly set a Text development environment to do that and then edit the Android app too. |
For the Text app I added some events requesting the Nextcloud app to reload everything: https://github.com/nicofrand/nextcloud-text/commits/fixReconnect/. Withing the Android app I caught the event but somehow the HTTP request always returns a 404: https://github.com/nicofrand/nextcloud-android/commits/reloadWebView |
As mentioned in chat, the urls are one time access only, so the android app would need to request a new url from the server through the direct editing OCS API, but I'm not familiar enough with the android code base to tell how to do that. |
For me this is happening even if I immediately unlock the device after it got locked, if I started "editing" (touching it once to open the keyboard is enough) before it locked. I can confirm the 403 responses on push, sync and attachments. |
Steps to reproduce
In Nextcloud android app, create or open a text file, like "notes.md"
Go to another app, like the browser. Stay there a while (a minute or two?)
Return to Nextcloud app
Expected behaviour
The text file should be editable
Actual behaviour
The text file is not editable.
"Reconnect" button appears partly obscured by the toolbar
Pressing the "Reconnect" button doesn't work, only "File could not be loaded. Please check your internet connection"
Android version
9
Device brand and model
Samsung S8
Stock or custom OS?
Stock
Nextcloud android app version
3.26.0
Nextcloud server version
27.1.3
Using a reverse proxy?
No
Android logs
No response
Server error logs
No response
Additional information
I'm sorry that I cannot provide a log file, I don't have logcat installed
The text was updated successfully, but these errors were encountered: