Skip to content

Refresh only newly imported subscriptions - #6237

Open
eliotcougar wants to merge 3 commits into
2dust:masterfrom
eliotcougar:codex/subscription-import-refresh
Open

eliotcougar wants to merge 3 commits into
2dust:masterfrom
eliotcougar:codex/subscription-import-refresh

Conversation

@eliotcougar

@eliotcougar eliotcougar commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Adding a subscription calls updateConfigViaSubAll(), so importing an eleventh subscription downloads the first ten again, sequentially. Fetch only subscriptions created by the current import. Build the existing-URL lookup once per batch and serialize lookup and creation to prevent duplicates across overlapping imports; download outside that lock.

Check both subscription payload and index writes, roll back failed saves, and download only successfully saved entries. Return named import results with saved group IDs and initial update outcomes. Report failed or partially successful imports accurately using existing localized messages, while retaining failed-download subscriptions for retry. Refresh affected group caches and the All group, preserving unrelated cached profiles. Correct the nested-lock return that previously bypassed cached data.

Route URL/share and scanner-shortcut imports through MainActivity and its MainViewModel so the work survives the importing activity closing and main-screen recreation. Consume each payload once, retain its target group and append mode, and keep loading visible until overlapping imports finish. Preserve Base64 input, URL-fragment names, and escaped paths/query values by decoding only the outer install URL parameter. Explicit Update All retains its existing behavior.

Related to #6233.

Validation

  • 107 JVM tests passed, including selective fetching, concurrent duplicate creation, failed payload/index writes and rollback, combined save/download outcomes, accurate feedback, cache invalidation, URL escapes, and loading/cancellation.
  • :app:compilePlaystoreDebugKotlin, :app:assemblePlaystoreDebug, and :app:assemblePlaystoreRelease passed.
  • Pixel 9 Pro x86_64 emulator, API 37: ten new endpoints received one HTTP request each; ten existing subscriptions received none and retained their profiles, timestamps, and selection. Verified cold/warm imports, recreation during a pending download, overlapping downloads, Base64 batches, duplicate imports, encoded URLs, direct profile sharing, All-group updates, and persisted profiles after reopening. Failed downloads remained available for retry.
  • Both feedback resource keys are present in all nine supported locales.
  • The temporary emulator fixture is excluded from this PR; committed tests are JVM tests only.

Not run: physical-device, physical-camera QR, live Internet/proxy checks, and a fresh standalone lint run for the latest commit. Network validation used controlled local HTTP endpoints. An earlier lint run reported four existing NewApi errors in RootManager, RootShell, and day/night themes; those files are unchanged from upstream.

@eliotcougar
eliotcougar marked this pull request as ready for review September 15, 2026 16:57
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.

1 participant