Skip to content

feat(backup): add SettingsLine in SyncingView to change backup path #18209

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

Open
wants to merge 1 commit into
base: feat/local-backup-popup
Choose a base branch
from

Conversation

jrainville
Copy link
Member

What does the PR do

Fixes #18128

Adds a SettingsLine above the "Backup Data" and "Import Backup" buttons that shows what is the current path for the backup and let's the user change that path.

Status-go PR: status-im/status-go#6699

Affected areas

  • settings service
  • SyncingView
  • Renamed formatImagePath to fromPathUri because it's not just useful for images

Architecture compliance

Screenshot of functionality

change-setting-path.webm

Impact on end user

Let's the user know what the path is and change it if needed

How to test

  • Have the feature flags enabled (in status-go remove the commented option in service.ext and in Desktop export FLAG_LOCAL_BACKUP_ENABLED=1)
  • Go to SyncingView
  • Play with the new setting line and click Backup Data

Risk

Tick one:

  • Low risk: 2 devs MUST perform testing as specified above and attach their results as comments to this PR before merging.
  • High risk: QA team MUST perform additional testing in the specified affected areas before merging.

-->

@jrainville jrainville requested review from a team, micieslak, caybro, alexjba and noeliaSD as code owners June 20, 2025 18:44
@status-im-auto
Copy link
Member

status-im-auto commented Jun 20, 2025

Jenkins Builds

Click to see older builds (11)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 7265e0e #1 2025-06-20 18:53:27 ~8 min tests/nim 📄log
✔️ 7265e0e #1 2025-06-20 18:54:52 ~9 min macos/aarch64 🍎dmg
✔️ 7265e0e #1 2025-06-20 18:57:36 ~12 min tests/ui 📄log
✔️ 7265e0e #1 2025-06-20 19:03:57 ~19 min linux/x86_64 📦tgz
✔️ 7265e0e #1 2025-06-20 19:11:29 ~26 min windows/x86_64 💿exe
✔️ 7265e0e #1 2025-06-20 19:12:26 ~27 min macos/x86_64 🍎dmg
✖️ c88fd91 #3 2025-06-23 15:39:05 ~46 sec tests/nim 📄log
✔️ c88fd91 #3 2025-06-23 15:46:00 ~7 min macos/aarch64 🍎dmg
✔️ c88fd91 #3 2025-06-23 15:59:06 ~20 min linux/x86_64 📦tgz
✔️ c88fd91 #3 2025-06-23 16:05:39 ~27 min macos/x86_64 🍎dmg
✔️ c88fd91 #3 2025-06-23 16:05:49 ~27 min windows/x86_64 💿exe
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 6e49a3d #4 2025-06-25 15:28:59 ~12 min macos/aarch64 🍎dmg
✔️ 6e49a3d #4 2025-06-25 15:41:56 ~25 min macos/x86_64 🍎dmg
✔️ 6e49a3d #4 2025-06-25 15:43:05 ~26 min tests/nim 📄log
✔️ 6e49a3d #4 2025-06-25 15:46:08 ~29 min tests/ui 📄log
✔️ 6e49a3d #4 2025-06-25 15:47:11 ~30 min windows/x86_64 💿exe
✔️ 6e49a3d #4 2025-06-25 15:53:08 ~36 min linux/x86_64 📦tgz
✔️ f7d465f #5 2025-07-09 17:57:01 ~7 min tests/nim 📄log
✔️ f7d465f #5 2025-07-09 18:01:30 ~11 min macos/aarch64 🍎dmg
✔️ f7d465f #5 2025-07-09 18:02:37 ~12 min tests/ui 📄log
✔️ f7d465f #5 2025-07-09 18:04:43 ~14 min linux/x86_64 📦tgz
✔️ f7d465f #5 2025-07-09 18:16:25 ~26 min windows/x86_64 💿exe

Copy link
Member

@caybro caybro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one minor thing

@jrainville jrainville force-pushed the feat/local-backup-popup branch from ca91432 to 033f0fe Compare June 23, 2025 15:14
@jrainville jrainville requested a review from a team as a code owner June 23, 2025 15:14
@jrainville jrainville requested review from saledjenic and removed request for a team June 23, 2025 15:14
@jrainville jrainville force-pushed the feat/backup-setting-change branch from 7265e0e to b2bec06 Compare June 23, 2025 15:36
@jrainville jrainville force-pushed the feat/local-backup-popup branch from 033f0fe to 8123023 Compare June 23, 2025 15:37
@jrainville jrainville force-pushed the feat/backup-setting-change branch from b2bec06 to c88fd91 Compare June 23, 2025 15:37
@jrainville jrainville requested a review from caybro June 23, 2025 15:37
@jrainville jrainville force-pushed the feat/local-backup-popup branch from 8123023 to 330ecf1 Compare June 25, 2025 15:11
@jrainville jrainville force-pushed the feat/backup-setting-change branch from c88fd91 to 6e49a3d Compare June 25, 2025 15:16
Copy link
Contributor

@noeliaSD noeliaSD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here some comments! :)

@@ -21,6 +21,14 @@ QtObject {
// Backup import properties
readonly property int backupImportState: syncModule ? syncModule.backupImportState : 0
readonly property string backupImportError: syncModule ? syncModule.backupImportError : ""
readonly property string backupPath: appSettings.backupPath
function setBackupPath(path) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know we have this pattern used in lots of stores right now but I would opt to start thinking on treating the Context Properties this way: "Public Read, Private Write", enforcing unidirectional data flow via:

  • Stores expose read-only state (readonly property)
  • Explicit mutation methods (setSomething())

@@ -21,6 +21,14 @@ QtObject {
// Backup import properties
readonly property int backupImportState: syncModule ? syncModule.backupImportState : 0
readonly property string backupImportError: syncModule ? syncModule.backupImportError : ""
readonly property string backupPath: appSettings.backupPath
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also another comment here regarding this pattern: I would avoid accessing directly to a Context Property since it can have performance penalties bc of needed lookups when accessing it. Instead, it's better to create a new and "private / internal" property and access it via a reference. Here my suggestion (indeed we use this pattern in other stores but still not consistently):

QtObject {
  id: d
  readonly property var appSettingsInst: appSettings
}

readonly property string backupPath: d.appSettingsInst.backupPath

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, this pattern gives us clearer ownership and cleaner boundaries too! :)

}

function toFileUri(path) {
return globalUtils.toFileUri(path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same reasoning than with appSettings applies here.

anchors.leftMargin: 0
anchors.rightMargin: 0
text: qsTr("Directory of the local backup files")
currentValue: root.devicesStore.backupPath
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would opt for declaring a new property backupPath and avoid accessing directly from the store here.
The idea is moving up the stores as much as possible and explicitly pass the needed data to the needed components, making an explicit api for each component and reducing passing unecessary data up / down.

id: backupPathDialog

title: qsTr("Select your backup directory")
currentFolder:root.devicesStore.toFileUri(root.devicesStore.backupPath)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same reasoning here related to the deviceStore access.


title: qsTr("Select your backup directory")
currentFolder:root.devicesStore.toFileUri(root.devicesStore.backupPath)
onAccepted: root.devicesStore.setBackupPath(backupPathDialog.selectedFolder)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here!

@jrainville jrainville force-pushed the feat/local-backup-popup branch from 330ecf1 to f79fdf2 Compare July 9, 2025 17:17
Fixes #18128

Adds a SettingsLine above the "Backup Data" and "Import Backup" buttons that shows what is the current path for the backup and let,s the user change that path.
@jrainville jrainville force-pushed the feat/backup-setting-change branch from 6e49a3d to f7d465f Compare July 9, 2025 17:49
@jrainville jrainville requested a review from noeliaSD July 9, 2025 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants