mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-12 09:13:23 +00:00
Backgrounding the app no longer pauses or loses mining: - commons: PoWPublishQueue checkpoints template jobs through a PoWJobPersistence hook (saved on enqueue, removed on finish/cancel, deduped by id so restore is idempotent) and fires onQueueActive on every enqueue. PoWReplay flattens the live continuation into a PersistedPoWJob record (broadcast / to-relays / schedule) that can be replayed headlessly. Opaque enqueueWork jobs (reactions, reposts, gift wraps) and anonymous posts stay in-memory on purpose — a throwaway key and its content must never touch disk. - amethyst: PowJobStore (atomic-rename JSON file, single-lane writer, 3-day staleness purge) and PowJobRestorer, which re-enqueues an account's checkpointed jobs on login and finishes them via the replay descriptor. Composers now pass the matching PoWReplay for the public, group-thread and scheduled paths. - PowMiningForegroundService: a shortService-type FGS started on every enqueue (~3 min guaranteed budget, no special permission) that keeps the process out of the cached-apps freezer while mining. Stops itself when the queue drains; on onTimeout it exits cleanly since the jobs are checkpointed. The notification is a live progress card (NotificationCompat.ProgressStyle): one track segment per post filling as jobs finish, indeterminate for a single post, per-kind text, a cancel-all action, and Live Updates rendering on Android 16+. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADb3dez9jPk6QqyQ1rTx4V