Skip to content

improve sync error handling - #3396

Open
alperozturk96 wants to merge 7 commits into
mainfrom
feat/improve-error-feedback
Open

alperozturk96 wants to merge 7 commits into
mainfrom
feat/improve-error-feedback

Conversation

@alperozturk96

@alperozturk96 alperozturk96 commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Changes

  • Exposes meaningful errors to the user instead just saying sync error.
  • Simplifies NotesServerSyncTask.java

@codacy-production

codacy-production Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Not up to standards ⛔

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 35 complexity · 0 duplication

Metric Results
Complexity 35
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.


<string name="error_sync">Synchronization failed: %1$s</string>
<string name="error_synchronization">Synchronization failed</string>
<string name="error_sync_locked">A note is open in another app. Close it there to sync your changes.</string>

@alperozturk96 alperozturk96 Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@jancborchardt Can you check the messages? Maybe we can provide better wording.

@github-actions

Copy link
Copy Markdown
Contributor

APK file: https://github.com/nextcloud/notes-android/actions/runs/38530041575/artifacts/11877942277
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

@alperozturk96
alperozturk96 requested a balanced review from Copilot October 14, 2026 07:58
@alperozturk96 alperozturk96 changed the title improve error handling improve sync error handling Oct 14, 2026
@alperozturk96 alperozturk96 added the sync file syncing label Oct 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Failure mapping can produce misleading messages and misses synchronous transport errors.

3 open findings
What changed in this PR

Improves sync-error messaging and extracts remote-note merging from the synchronization task.

Changes:

  • Maps sync failures to user-facing messages.
  • Refactors push handling and remote-note merging.
  • Adds structured sync exceptions.

All four new source files are Kotlin. Among changed files, MainActivity.java and strings.xml remain over 300 lines.

File Description
strings.xml Adds sync-error messages.
SyncFailureReason.kt Maps HTTP statuses to failure reasons.
RemoteNotesMerger.kt Extracts remote-note reconciliation.
NoteSyncException.kt Represents failed note operations.
NotesServerSyncTask.java Refactors push, pull, and failure handling.
SyncErrorMessage.kt Selects messages from exceptions.
MainActivity.java Displays specific sync errors.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread app/src/main/java/it/niedermann/owncloud/notes/persistence/SyncFailureReason.kt Outdated
@github-actions

Copy link
Copy Markdown
Contributor

APK file: https://github.com/nextcloud/notes-android/actions/runs/38557863521/artifacts/11892095883
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
@alperozturk96
alperozturk96 force-pushed the feat/improve-error-feedback branch from 6f97f00 to 6b0ae68 Compare October 15, 2026 09:32
@alperozturk96

alperozturk96 commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator Author

@daniele-verducci PR is updated, could you please review again?

@github-actions

Copy link
Copy Markdown
Contributor

APK file: https://github.com/nextcloud/notes-android/actions/runs/38713756532/artifacts/11961743497
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants