Skip to content

Readable sync errors and a save reminder after Test Connection - #42

Merged
juev merged 1 commit into
mainfrom
41-readable-sync-errors
Oct 5, 2026
Merged

juev merged 1 commit into
mainfrom
41-readable-sync-errors

Conversation

@juev

@juev juev commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Closes #41

What

  • Readable HTTP errors. The first line names the error (linkding rejected the API token (HTTP 401), linkding API not found (HTTP 404), otherwise linkding returned HTTP <code>). A JSON body follows as text: detail as is, field errors as field: message. Plain text is kept; an empty body shows only the first line. This text is used on the queue card and in the Test Connection result.
  • Notification text. Each persistent sync problem has a short instruction, for example "Saved links stay in the queue. Check the API token in Settings." The notification shows it instead of the server response.
  • Save reminder. Test Connection checks the values typed in the fields and does not save them, so a passed test followed by Sync now kept failing with the saved token. After a successful test of a server URL or token that differs from the saved one, Settings shows "Save settings to sync with this connection."
  • R4, R22, and R28 in the spec and the Test Connection sentence in README are updated. R22 used to require the full response body; it now requires the same details as text.

Checks

  • assembleDebug lintDebug testDebugUnitTest connectedDebugAndroidTest on the API 36 emulator: build and lint pass, 74 instrumented tests pass.
  • New tests: ApiErrorsTest, QueueUiTest.testedButUnsavedTokenAsksToSaveSettings; SyncNotifierTest.workerNotifiesRejectedTokenAndClearsAfterSuccess now checks the notification text and the queue card error.

HTTP errors no longer carry the raw JSON body: the first line names the
error and the body follows as text. The notification for a persistent
problem now says what to change in Settings instead of repeating the
server response.

Test Connection checks the typed token without saving it, so a passed
test followed by Sync now kept failing with the saved token. Settings
now asks to save after a successful test of unsaved values.

Closes #41
@juev
juev merged commit 3484ee6 into main Oct 5, 2026
1 check passed
@juev
juev deleted the 41-readable-sync-errors branch October 5, 2026 11:21
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.

Readable sync errors and a save reminder after Test Connection

1 participant