* fix(local-backup): don't overwrite a good backup with empty state (#7901)
After a WebView IndexedDB eviction the live NgRx store can boot empty.
The 5-min local-backup timer would then clobber the last good copy in
durable storage (Android SQLite KeyValStore, iOS file, Electron file)
with nothing. Gate _backup() with hasMeaningfulStateData() so empty/
degraded state can never overwrite a good backup, mirroring the existing
snapshot/compaction empty-overwrite guard.
* feat(local-backup): keep a second backup generation on mobile (#7901)
A single overwritten row/file is fragile: one bad or corrupt write cycle
can erase the only copy. Add a two-generation ring on the single-slot
mobile platforms (Android KeyValStore key, iOS file) — promote the
current backup to a 'prev' slot before overwriting, and restore from the
newest usable slot, falling back to prev when the primary is corrupt or
empty. Electron already keeps rotated, timestamped backups, so it is left
unchanged.
Adds backup-ring.util (isUsableBackupStr / selectBestBackupStr) with full
unit coverage; the iOS write is split behind _writeIOSFile so the promote
ordering is testable without the Capacitor Filesystem proxy.
* fix(android): store a real timestamp in KeyValStore KEY_CREATED_AT (#7901)
ContentValues binds "time('now')" as a literal string rather than letting
SQLite evaluate it, so every row's KEY_CREATED_AT held a constant text
value instead of a write timestamp. Store System.currentTimeMillis() so
the column is actually usable for ordering/debugging.
* fix(local-backup): harden restore paths from multi-agent review (#7901)
- loadBackupIOS: return '' instead of throwing when no usable backup
exists. askForFileStoreBackupIfAvailable runs from the fire-and-forget
_initBackups() at startup, so a throw became an unhandled rejection; ''
degrades to the existing import-error snack and mirrors loadBackupAndroid.
- Consolidate the Android newline escape into loadBackupAndroid (the single
escape site) and drop the now-redundant re-escape + log line at the call
site, removing a full-string pass on the restore path.
* feat(local-backup): restore fuller generation, show contents (#7901)
Two restore-path improvements (issue #7901 item 4):
- selectBestBackupStr now prefers the ring generation carrying MORE
data when both slots are usable (tie -> primary). After an eviction
the live store can boot near-empty and a 5-min backup may write that
degraded state to the primary; the full copy survives in prev, and
restore must surface the full one rather than the newer-but-smaller.
- The mobile restore prompt loads the backup first and names its task
and project counts (new RESTORE_FILE_BACKUP_MOBILE string), so a user
never blindly discards the only copy of their data. Falls back to the
generic prompt for an unparseable blob.
Note: a 'defer backups until the restore decision resolves' guard was
considered but is already structurally guaranteed -- init() (the only
thing starting the 5-min timer) runs after the synchronous restore
confirm in _initBackups, so the timer cannot fire before the decision.
* fix(local-backup): restore the newest backup, not the larger one (#7901)
Multi-agent review of
|
||
|---|---|---|
| .. | ||
| .idea | ||
| app | ||
| fastlane/metadata/android/en-US/changelogs | ||
| gradle/wrapper | ||
| .gitignore | ||
| ALWAYS_TAG_RELEASES_FOR_FDROID | ||
| build.gradle | ||
| capacitor.settings.gradle | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| LICENSE | ||
| README.md | ||
| README_OFFLINE.md | ||
| README_ONLINE.md | ||
| settings.gradle | ||
super-productivity-android
Android App for Super Productivity (https://super-productivity.com/).
I am not an Android developer, so help would be very welcome!!
New Connectivity-Free Mode is Here!
This feature was added on October 7, 2024. See Pull Request #57.
You can now use the core features of the app without an internet connection, offering a smoother and more reliable experience. We've made several key updates to enhance usability:
- Connectivity-Free Mode Support: Enjoy uninterrupted access to the app's main features without needing a network connection. You can still sync with WebDAV, Dropbox, or choose to work entirely offline without any network access.
- Online-Only Mode (Compatibility Mode): For users who prefer or need the traditional experience, the app still supports the original mode, which requires an internet connection for functionality.
- CORS Issues Resolved: Fixed cross-origin resource sharing (CORS) problems, especially for WebDAV sync, ensuring secure and smooth synchronisation with local or hosted resources.
- Enhanced Security: Strengthened data protection to keep your information secure, even when offline.
- Seamless Upgrade: Existing users can continue using the app in Online-Only Mode (Compatibility Mode) without any disruptions, while new users can immediately enjoy the benefits of Connectivity-Free Mode. Future updates will also include a smooth migration plan for everyone.
Update now to enjoy these exciting new features and improvements!
Launch Modes
The app supports two launch modes:
- Connectivity-Free Mode (Recommended) – Use the app without an internet connection.
- Online-Only Mode (Compatibility Mode) – Requires an internet connection to connect to production, local development, or self-hosted servers.
Configuring Launch Mode
To configure the launch mode, adjust the LAUNCH_MODE setting in the app_config.properties file:
- 0: Default behaviour (read from SharedPreferences)
- 1: Force Online-Only Mode (Compatibility Mode)
- 2: Force Connectivity-Free Mode (Recommended)
Recommendation: Set LAUNCH_MODE to 2 for Connectivity-Free Mode.
How to Adjust LAUNCH_MODE
- Locate the
app_config.propertiesfile in the project's root directory. - Open the file in a text editor.
- Find the
LAUNCH_MODEsetting and set it to your desired mode (0,1, or2).
LAUNCH_MODE=2
Important: The app_config.properties file is intended for local modifications only. DO NOT COMMIT this file unless you are sure of what you are doing.
Detailed Configuration Guides
- Connectivity-Free Mode Documentation (Recommended): Step-by-step guide to setting up and building the app in Connectivity-Free Mode.
- Online-Only Mode (Compatibility) Documentation: Step-by-step guide to setting up and building the app in Online-Only Mode.