Skip to main content
Portfolio OS

Case study // reliable software

When a scrobble's result is unknown: designing a safer delivery queue

A source-backed look at local idempotency, durable leases, bounded retries, and the difference between a provider acknowledgement and a user's local confirmation.

7 min readBy Rahul Muraleedharan
  • C#
  • .NET
  • SQLite
  • Reliability
  • Scrobblix

A scrobble is more than an HTTP request. It is a record of a listening event, and a trustworthy client has to explain what happened when delivery is interrupted. The difficult case is not a clear success or a clear rejection. It is the request that may have reached Last.fm even though the app never received—or never saved—the acknowledgement.

The dangerous assumption behind automatic retries

Imagine the app sends a scrobble, the provider accepts it, and the process exits before the local database records the response. When the app starts again, the local queue still looks unfinished. Retrying immediately may submit the same listening event twice.

A timeout or a lost response does not prove that the provider rejected the request. The remote action and the local record can disagree for a short period. Treating every missing response as a transient failure quietly turns a recovery mechanism into a duplicate generator.

Scrobblix therefore models an unknown submission outcome as its own state. The goal is not to make ambiguity disappear; it is to keep that ambiguity visible until there is enough evidence to act safely.

Local idempotency is not provider-side idempotency

Before delivery, Scrobblix builds a stable local action key from the provider, account, action type, and play ID. Each part is length-prefixed before concatenation, so identifiers containing the same separator characters cannot accidentally produce the same composite string.

Encode(provider) + Encode(accountId) + Encode(actionType) + Encode(playId)

That key helps deduplicate actions in the local queue. It does not make Last.fm's API idempotent, and it cannot tell the client whether a request was accepted remotely. Those are separate guarantees; confusing them is the root of many unsafe retry designs.

Source: ProviderActionIdempotencyKey.cs.

Lease the work, then classify the result

The SQLite store claims one due action inside a transaction, marks it InFlight, increments its attempt count, and assigns a one-minute lease to the worker. The processor then submits the action and persists a classified outcome: provider accepted, provider ignored, authentication blocked, retry scheduled, retry exhausted, permanent failure, or submission outcome unknown.

The lease makes worker ownership explicit. If the process disappears and the lease expires, recovery treats a scrobble differently from an ephemeral action: a scrobble becomes SubmissionOutcomeUnknown, while other action types can be returned to the retry path. This is deliberately conservative because scrobble duplication is harder to undo than a missed transient update.

Now-playing updates have a different lifetime again. They describe the current listening state, not a permanent history event, so stale queued now-playing actions are cancelled after the five-minute freshness window instead of being replayed much later.

Sources: SqliteProviderActionStore.cs and ProviderActionProcessor.cs.

Bound retries instead of retrying forever

For transient outcomes, the processor honours a positive provider retry hint but caps it at 24 hours. When there is no usable hint, it applies exponential backoff: one, two, four, eight, sixteen, thirty-two, then sixty minutes. Automatic delivery is bounded at eight attempts; after that, the item becomes RetryExhausted and needs attention.

Authentication failure is not treated as a normal network retry. It moves the action into an authentication-blocked state so the account can be repaired before those actions resume. Provider-declared ignored events and permanent failures are also recorded as distinct outcomes, rather than being folded into a generic red error.

Recovery needs evidence, not a guess

The queue presenter deliberately separates three meanings that can otherwise look like the same green “success” label: accepted by the provider, confirmed locally by the user, and a legacy accepted state whose evidence is unspecified. A local confirmation records what the user checked; it does not make a new request to Last.fm or manufacture a provider acknowledgement.

The confirmation guidance asks for the exact play: match its start time, artist, and track on the user's Last.fm profile. Seeing the same song earlier is not proof that this particular play was delivered. The interface also shows the original play start separately from the queue due time, because a retry schedule can move while the listening event's timestamp must not.

The domain test suite uses a synthetic play to assert these distinctions, including unknown outcome, provider acceptance, local confirmation, unspecified legacy evidence, missing play-start time, and the difference between play-start and queue-due labels. These are deterministic tests of the state and presentation rules, not a real-account delivery soak test.

Sources: QueueActionPresenter.cs and Scrobblix.Domain.Tests.

What the current release does—and does not—prove

The Windows beta 11 preview, published on 11 November 2026, improves how the queue displays the original play time, mutable queue due time, provider-versus-local acceptance evidence, and unknown-outcome guidance. Its release notes explicitly say the update does not clear, retry, or reconcile queue rows. It is an evidence-clarity change, not a new claim that uncertain submissions have been delivered.

Scrobblix remains a development-preview project. The Windows beta 11 installer is unsigned and manually updated; Android has a separate alpha release track. Real-account/device soak, credential migration, interrupted-upgrade rollback, and other release gates remain distinct from the synthetic state-machine tests.

See the Windows beta 11 release notes, the release process, and the Scrobblix project page for the current evidence and limitations.

A durable queue should never convert “I don't know whether the provider received it” into “send it again.” Unknown is a real state, and a useful interface gives the user enough evidence to decide what happens next.

Source-first engineering notes by Rahul Muraleedharan. Claims in this article link to Scrobblix source, tests, or published release notes; no user counts, delivery rates, or performance results are inferred.