Skip to content

Saved subscriptions: auto-refresh + change notifications#2

Merged
useruserdev merged 1 commit into
mainfrom
subscriptions
Jun 3, 2026
Merged

Saved subscriptions: auto-refresh + change notifications#2
useruserdev merged 1 commit into
mainfrom
subscriptions

Conversation

@useruserdev
Copy link
Copy Markdown
Owner

Adds saving multiple subscriptions with periodic refresh and local notifications when configs change (e.g. when servers get blocked).

Features

  • Subscriptions tab — save multiple happ:// links or plain http(s) sub URLs, view configs, pull-to-refresh, swipe-delete.
  • Auto change notifications — when a subscription's set of config URIs changes, a local notification fires (+X / −Y). Notifications + background refresh are on by default.
  • Refresh strategy — foreground + on-open + BGAppRefreshTask (opportunistic; iOS controls exact timing). Min-interval setting (1/3/6/12 h).
  • Plain URL supportExtractionService now accepts an http(s) subscription URL directly (skips decryption), extracts vless/etc. and reports changes.

Architecture

  • SavedSubscription + SubscriptionStore (JSON on disk)
  • ChangeDetector (pure diff), RefreshService (per-sub, fault-isolated), NotificationService, RefreshCoordinator, BackgroundRefresh
  • UI: list / detail / add sheet; Save button on Extract; Settings 'Обновления' section
  • Info.plist with UIBackgroundModes + BGTaskSchedulerPermittedIdentifiers; bump to 1.0.2 (build 3)

Tests

ChangeDetector, SubscriptionStore round-trip, RefreshService (change/no-change/disabled/fault-isolation), plain-URL extraction.

Authored on Windows — not compiled locally; relying on CI build + simulator tests.

Adds a Subscriptions tab so users can save multiple happ:// links (or plain http(s) sub URLs), refresh them, and get notified when configs change (e.g. when servers get blocked).

- SavedSubscription model + SubscriptionStore (JSON on disk).
- ChangeDetector: pure diff of config-URI snapshots (added/removed).
- RefreshService: re-runs extraction per subscription, detects changes, fires notifications; one failure does not abort the batch.
- NotificationService: local UNUserNotificationCenter alerts on change.
- RefreshCoordinator: foreground + pull-to-refresh, applied on the main actor.
- BackgroundRefresh: BGAppRefreshTask (com.happwn.refresh), opportunistic.
- ExtractionService now accepts a plain http(s) subscription URL (skips decryption).
- UI: Subscriptions list, detail (edit name, per-sub notify, refresh, delete), add sheet; Save button on Extract; Settings 'Обновления' section (notifications, background refresh, min interval). Notifications + background refresh default ON.
- Info.plist with UIBackgroundModes + BGTaskSchedulerPermittedIdentifiers; project.yml wired to it. Bump to 1.0.2 (build 3).
- Tests: ChangeDetector, SubscriptionStore, RefreshService, plain-URL extraction.
@useruserdev useruserdev merged commit de54d57 into main Jun 3, 2026
3 checks passed
@useruserdev useruserdev deleted the subscriptions branch June 3, 2026 19:10
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