# Nextcloud Android Client Version 3.30.1
Dear Community,
It is with great regr…et that we have to inform you that a recent version of the Nextcloud Android Client, specifically version 3.30.1, has introduced a bug that may cause one or more of the following issues:
- increased battery usage and device temperature,
- increased mobile and non-mobile data usage,
- increased storage usage, and
- synchronisation of files not previously selected for synchronisation.
Please note that manual intervention will be required by users who have upgraded to the affected version.
## Updating - How To Disable Two-Way Synchronisation
We have carefully investigated this issue and released new versions which aim to address these issues.
With **Version 3.30.4** we have introduced a new way to manage two-way sync. To access this redesigned menu open *Settings* → *Internal two way sync*.
| ![Image](https://github.com/user-attachments/assets/d0db3e57-1ccc-4c7c-b554-4e67a6ed1262) | ![Image](https://github.com/user-attachments/assets/a4d5e3e9-7b12-44b1-8c8b-946814f2b219) |
| --- | --- |
This menu allows users to globally enable or disable two-way synchronisation. Disabling this will ensure that no two-way synchronisation will occur in the future. As before, users have the option to selectively remove individual folders using the **×** icon next to the folder name. For advanced users, there is also an option to set the interval at which the Nextcloud Android Client will attempt two-way synchronisation.
We have also added a button to disable two-way synchronisation for all folders. This option will appear in the overflow menu (⋮) if two-way synchronisation is enabled for at least one folder. Furthermore, this will attempt to cancel any transfers in progress and update the database to exclude those folders from being synchronised again.
### Removing Local Files
Some users have experienced increased storage usage on their device. Allocated storage space can be freed by removing local files: open the *On device* tab and long press on any file or folder. Then open the overflow menu (⋮) to *Select all* files. When all files are selected, re-open the overflow menu and select *Delete*. When prompted, select *Local only*. **This is important, as selecting *Delete* in this dialogue will also remove all selected files from the server.** The removal process will take some time depending on how many files have been downloaded.
### How to Upgrade
The Nextcloud Android Client can be updated via your preferred installation method. All versions are also available on [GitHub](https://github.com/nextcloud/android/releases) for download.
As of 05/11/2024, version 3.30.4 is available from [F-Droid](https://f-droid.org/packages/com.nextcloud.client/). This version includes all major fixes and the redesigned management interface.
Unfortunately, the [Google Play](https://play.google.com/store/apps/details?id=com.nextcloud.client) release will take some more time to be available as we are currently blocked by Google. This is, however, tracked in a different issue: #13871.
We will update this issue as soon as the releases are available.
## Mitigation
**We strongly recommend that all users to upgrade to version 3.30.4 or later using your preferred method to resolve these issues.** This version includes several fixes and changes that should resolve any issues related to two-way synchronisation. Please refer to the explanation above for information. If this version is not available for you, or if something else is blocking this update, there are several options to mitigate any unwanted behaviour.
### Option 1 - Manual Removal
From version 3.30.2, users have the option to quickly check and stop two-way synchronisation for specific folders. To access this menu open *Settings* → *Internal two way sync*. On the following screen one will see all folders scheduled for two-way synchronisation and have the option to exclude folders using the **×** icon next to the folder name. If a blank page is displayed instead, no folders are scheduled for two-way synchronisation.
![Two-Way Sync Settings](https://github.com/user-attachments/assets/dd271b01-95d0-4bf2-a89c-435792de6f01)
### Option 2 - Reinstalling
<details><summary>For version 3.30.1 to 3.30.3 (outdated)</summary>
<p>
The simplest option is to reinstall the Nextcloud Android Client. Due to the technical nature of the issue reinstalling any version above 3.30.0 will resolve the issue. The process of reinstalling an app varies from Android version to Android version. However, the general process will be similar to the following:
1. Close any open app and open the app drawer
2. Press and hold on the Nextcloud app
3. Select App info
4. Select Uninstall
5. Confirm with Ok
6. Open App Centre of choice
- Depending on your vendor, this will have different names, such as *Google Play Store*, *App Gallery*, *F-Droid*, etc.
7. Download and install Nextcloud Android Client
**Please note that any local data of the Nextcloud Android Client that is present on the mobile device will be lost during the removal process.**
</p>
</details>
### Option 3 - Reinitialise Local Account
<details><summary>For version 3.30.1 to 3.30.3 (outdated)</summary>
<p>
Another option, if you prefer to keep the current version installed, is to remove the current user account and it add again. This should have a similar effect to reinstalling the application. To re-initialise your account in the Nextcloud Android Client, follow these steps:
1. Open Nextcloud app
2. Open user selector (your profile picture on the top right)
3. Select Manage accounts
4. Open the overflow menu (⋮) for the affected account
5. Select Remove account
6. Confirm by choosing Remove local account and pressing the Remove account button
7. Re-add your account by selecting Add account
8. Finish account set-up as normal
**Please note that any local data of the Nextcloud Android Client that is present on the mobile device will be lost during the removal process.**
</p>
</details>
### General - Enabling Data Limit and Warning
Many mobile network operators charge their subscribers an additional fee when they exceed their data allowance. To avoid these charges, most versions of Android offer some kind of safety measures. These include a Data Limit and Data Warning. The latter notifies you once the specified amount of mobile data has been used up. The former allows you to set a hard limit after which Android will disable mobile data and prevent you from using any more. Also note that you will *not* be able to use *any* apps that require an active data connection, such as Internet messengers.
Settings to enable and configure the Data Limit and Warnings can usually be found in the device settings.
1. Open Settings app
2. Select Network and Internet
3. Select Internet
4. Select ⚙ next to your mobile (data) carrier
5. Select Data warning and Data limit
## Related Issues
- #13738
- #13871
## Technical Background
Internally, the Nextcloud Android Client uses a database table to keep track of all files. This table has been extended by two columns to accommodate the new two-way sync feature: `internal_two_way_sync_timestamp` and `internal_two_way_sync_result`. The latter of these columns is not relevant for the purposes of this investigation.
We use the timestamp to keep track of two things. Firstly, the date when the corresponding file was last synchronised. Secondly, whether the file should be synchronised at all. If the timestamp value of a file contains a valid timestamp greater than `0` the file will be scheduled for synchronisation. In this case `0` means the file has never been synchronised. A value of `-1` indicates that a file should **not** be synchronised at all.
On a clean install of the Nextcloud client, all records in the `filelist` table will be initialised with a timestamp value of `-1`. When upgrading from an older version, the database is migrated to fit the new scheme. During this migration, the timestamp column is added to the table and initialised with a default value of [`null`](https://en.wikipedia.org/wiki/Null_(SQL)). This must be handled carefully when interpreting database values, as improperly handled null values are known to cause a variety of problems. In this case, `null` represents *unknown*; the file has never been synchronised and the user hasn't made a decision about whether or not it should be synchronised.
In a recent update, a change was made to mitigate [null pointer](https://en.wikipedia.org/wiki/Null_pointer) exceptions during file synchronisation. Due to a small oversight, this also meant that all null values would be interpreted as `0`. While this fixed the null pointer issues, it unfortunately introduced a new problem.
When a user *updates* to an affected version, the column is filled with `null`, which is interpreted as `0`. After a while, a background worker will look up all files that need to be synchronised in the aforementioned table. Since all files have a `0` timestamp, it will try to synchronise them all.
For technical reasons, we also store the root folder, which contains all other files, in the same database. This folder is represented by a record having `/` as its filename. Therefore, all folders and files are scheduled for synchronisation.
As it is normally not possible to select the root folder for two-way sync, we have excluded it from the synchronisation process in the patched versions.
Due to the nature of our apps and release channels, rollbacks to previous versions are not possible. Instead, we have released newer versions that fix these issues.
### Version History
- [3.30.1](https://github.com/nextcloud/android/releases/tag/stable-3.30.1) released on 11/10/2024
- introduced two-way sync
- upgrading to this version will cause the app to malfunction
- [3.30.2](https://github.com/nextcloud/android/releases/tag/stable-3.30.2) released on 21/10/2024
- first patch to address two-way sync issues
- fixes `null` conversion
- includes UI to remove folders from two-way sync
- includes an additional check to stop unwanted background synchronisation of root folder
- [3.30.3](https://github.com/nextcloud/android/releases/tag/stable-3.30.3) released on 22/10/2024
- second patch to address two-way sync issues
- two-way sync will now only run when connected to Wi-Fi
- [3.30.4](https://github.com/nextcloud/android/releases/tag/stable-3.30.4) released on 31/10/2024
- third patch to address two-way sync issues
- further improvements to two-way sync logic
- includes improved UI to manage two-way sync
- includes global toggle to disable two-way sync
- includes button to stop all scheduled two-way sync operations and remove all folders from two-way sync