2 min read

Daily streak takeovers

Claim a day on someone else's streak, keep yours alive, and get a push when your streak is in danger.

Remix Team's avatar

Remix Team

Remix Team

Daily streak takeovers

The streak data model

Streak takeovers required extending the streak data model so a day on the calendar can be claimed and attributed. The streak calendar tracks which days a player has filled, and the takeover feature lets a claim be recorded against a calendar day. The model stores the claim relationship so the calendar can render who holds a given day and so a player's own streak stays intact when a day is covered, rather than recomputing streak state from raw play events each render.

The competition angle is the reason this is social rather than solitary: claiming a day turns a private habit loop into a contest between players, which is the platform's lean toward competition over passive engagement. The data model is built to support that contest cleanly, with claims as first-class records rather than a derived flag.

The reward-grant transaction

The reward side is the part that has to be exactly right. Streak calendar rewards are granted through a single transaction that writes the inventory change and its matching event together. Balances are read from and written to user_inventory as the source of truth, and the grant goes through the shared inventory update path so the balance change and the event record are committed atomically in the caller's transaction. A missing inventory row is treated as a zero balance, and the first grant creates the row and records the event in the same transaction. That means a streak reward cannot half-apply: either the balance moved and the event exists, or neither did.

Notification hooks

We added notification hooks so streak state changes drive pushes. When a streak is at risk of breaking, or when a takeover targets a player's streak, the hook fires a notification tied to the actual event rather than a generic reminder. We also shipped ending-soon alerts for sweepstakes off the same notification path and tightened the notification records so a push reflects the event that triggered it. Less noise, and each push maps to something that really happened.

The claim flow was simplified along the way, and several avatar rendering bugs on the streak calendar screens were fixed so the calendar renders the correct avatars for claimed days.