Skip to content

Stop sync without a usable server, apply defaults at send time, add Direct Share - #36

Merged
juev merged 7 commits into
mainfrom
35-sync-gating-send-time-defaults-direct-share
Oct 5, 2026
Merged

juev merged 7 commits into
mainfrom
35-sync-gating-send-time-defaults-direct-share

Conversation

@juev

@juev juev commented Oct 5, 2026

Copy link
Copy Markdown
Owner

What changes

Sync no longer runs, and no background work is scheduled, when it has nowhere to send links: either the server is not set up, or a persistent error stopped it. A persistent error is a rejected token (401/403), a missing API (404), a non-HTTPS server URL, or an unreadable token. Sync starts again when the user saves settings, taps Sync now, or taps Retry.

Saving a link in that state adds the reason to the Toast, shows a notification that returns on every such save, and the Queue status line names the problem.

Default tags, unread, and archive are now applied when a link is sent, so changing them affects links already in the queue. Queue entries no longer store the two flags; Room migration 2 to 3 drops the columns and keeps every other field.

ShareDing publishes a Direct Share target. The minimum version moves to Android 10 (API 29), the first one with sharing shortcuts.

Notes for review

  • The scheduler checks whether sync can run, so no caller can enqueue work around it. Without a server, Sync now and deletion cancel pending work and create none.
  • The periodic recovery check is registered only while sync can run.
  • The sharing shortcut is not excluded from the launcher. On Android 16 a shortcut excluded from the launcher is not kept as a dynamic one, and then the share sheet does not offer it.
  • Links queued before the upgrade keep the default tags stored with them.

Verification

./gradlew --continue clean assembleDebug assembleRelease testDebugUnitTest lintDebug lintRelease connectedDebugAndroidTest passes with 73 connected tests on an API 36 emulator. On the same emulator the system share sheet showed ShareDing in the Direct Share row, and selecting it queued the link.

Closes #35

juev added 7 commits October 5, 2026 11:20
Sync can run only when the server URL and token are set and no
persistent error has stopped it. The scheduler checks this itself, so
sharing, the add form, deletion, startup, and new networks no longer
enqueue a job that would start and exit. The periodic recovery check is
registered only while sync can run.

Refs #35
A rejected token (401/403), a missing API (404), a non-HTTPS server URL,
or an unreadable token cannot be fixed by another attempt. The worker
now records the problem and finishes without a retry, and no sync work
is scheduled until the user saves settings, taps Sync now, or retries a
link. Transient errors keep the exponential backoff.

Refs #35
Saving a link while the server is not set up, or while a persistent
error has stopped sync, now adds the reason to the Toast and shows a
notification that returns on every such save. The Queue status line
names the problem that stopped sync.

Refs #35
Default tags, unread, and archive are read from the current settings
for every POST, so changing them affects links that are already queued,
including links saved before the server was set up. A queue entry keeps
only the tags typed for it.

BREAKING CHANGE: Room schema version 3 drops the unread and archived
columns. Links already queued keep the default tags they were saved
with and take the flags from the current settings.

Refs #35
ShareDing now appears in the Direct Share row of the share sheet. The
app publishes one long-lived sharing shortcut on start and again after
each share, and still registers a single ACTION_SEND target.

BREAKING CHANGE: the minimum version is Android 10 (API 29), the first
one with sharing shortcuts. Installs on Android 9 stay on 0.2.x.

Refs #35
Default tags are no longer merged into a link in the Add Bookmark form,
so its length check does not see them. Check them when settings are
saved instead.

Refs #35
@juev
juev merged commit 1be80c7 into main Oct 5, 2026
1 check passed
@juev
juev deleted the 35-sync-gating-send-time-defaults-direct-share branch October 5, 2026 08:49
@juev juev mentioned this pull request Oct 5, 2026
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.

Stop sync without a usable server, apply defaults at send time, add Direct Share

1 participant