Zero was not a ceiling

A creator can write their own commission rate, so the server caps it at what the brand agreed to. For most of the catalogue the cap never ran, because those products carried no commission of their own.

3 min readGlitz · Link stage

On the marketplace, a creator who accepts a brand's collaboration gets a tracking link and a commission rate. The rate lives on the collaboration record, and the app has to be able to write that record, so the rules let either side change almost any field on it, the rate included. The rate a creator's phone sends is not a number the server can trust. The product's own commission is different. Only the brand can write it. That makes it the ceiling, and the server caps whatever the collaboration asks for at the product's commission before any of it becomes money.

A guard around the guard

The cap arrived on 11 August 2026, in the function that mints a commission for a purchase, with a comment beside it naming its cost. It sat inside a condition: cap the rate if the product's commission is above zero. That reads like caution. A product with no commission has nothing to cap against, so leave the rate alone. But a product with no commission is not an odd record. Products imported from a brand's own store arrive without one and are meant to earn through the brand's company-wide rate. When I counted, 142 of the 154 active products were exactly that. For those, the cap was skipped, and a rate the creator had written onto their own collaboration would have been paid as written. Ninety-nine percent was a legal value.

Three copies

The cap was not one function. It was a pattern written three times: in the purchase path, in the path for orders from connected stores ten days later, and in team routing, pulled into its own file on 21 October. Every copy carried the same guard. Only the first carried the comment, and only the first carried the seven-day grace window, under which a creator keeps their old rate for a week after a brand cuts it. On the other two paths the old rate was a permanent floor.

Found by reading

Nobody reported it. I found it on 23 October, reading the source to write this note, and the note waited. The fix merged the next day. One function now decides a rate for every path: the collaboration's rate with its grace window, capped at the product's commission, where zero caps to zero; then the product's commission; then the brand's company-wide rate. A creator's written rate on a product with no commission falls through to a number the brand set. The functions that mint commissions were redeployed on 30 and 31 October. A battle test seeds the cases against production with throwaway records, among them a creator asking ninety-nine on a product with no commission, which now pays nothing where it used to pay ninety-nine. Its run with the fix passed 35 of 35. Production showed no damage either way: read back on 7 November, every one of the 33 commissions recorded so far is at or below its product's commission as it stands today.

The same day a rung went in above the cap: a brand can reward its best creators with a tier rate, earned monthly, and that rate may exceed the product's commission. That is not a hole in the ceiling. The brand set both numbers. The rule was never that a rate cannot pass the product's commission. It was that no number the creator can write decides what they are paid.

What it still gets wrong

When a brand lowers a product's commission, the creator is told their old rate is protected for seven days. The cap reads the product's new commission, so the old rate is clamped to the new one in the same instant. The window protects nothing in the case it was built for, and the notification still says it does. Fixing that is a decision, not a line: honour the window with the old commission as its own ceiling, or stop promising it. That decision belongs to the client, and it is written down for them.

Why it belongs on this page

The guard was not careless. Skip the cap when there is nothing to cap against is what a careful person writes, and it would pass a review. What it missed was a fact about the data: which products have no commission, and why. That fact lived in the store importers, written by the same hand. A cap is a claim about every record, and the way to check it is to count the records it skips.

More notes
  • The webhook that credits twiceA payment processor delivers every result at least once. The interesting engineering is in what happens when your side fails halfway through.
  • A ledger you can edit from a route handler is not a ledgerWhy every movement of value on the payments platform goes through a Postgres function, and what it costs to keep it that way.
  • Four rows that were not theirsHardening multi-tenant row-level security in four reversible phases, verified by impersonating a member and counting what they could see.
  • The bug inside the fixA payout race, the fix for it, the bug inside that fix, and why it is the best argument I have for one person owning the whole path.
  • The sale that arrives with no referrerA creator shares a link on Instagram, the buyer taps it, installs the app and purchases. Nothing in that chain carries the creator's name across. Here is what does.
  • The minimum that belongs to someone elseHeld commissions are released to creators once a brand's payout minimum is met. Group the money by creator, the obvious way, and one brand's minimum ends up holding another brand's money.
  • The commission that must not mint twiceA buyer pays and the platform owes a creator a commission. Between those two facts sit a colluding pair, a call that arrives twice, and a cart with three items on one payment.
  • The rule that has to be written twiceFirestore security rules do not cascade to subcollections. Forget that in one place and a single query returns every private message on the platform.
  • Thirty days in the ledgerSplitting a payment at charge time is simpler and wrong: a refund after the creator is paid is a clawback nobody enjoys. Holding the money creates a different set of problems, and each piece of machinery around the hold answers one of them.
  • Arbitrary but consistentA gym's assessment answers become rules that swap an exercise for a member before a session. Two rules can disagree about the same movement. The code says who wins, and the comment admits how.
  • The number that ducked every thresholdA deposit arrives from a browser carrying two numbers. The platform scored one of them and charged the other, and every limit it had was measuring the wrong figure.
  • The second one tells you the shapeHigh-risk merchants get dropped by processors, so the platform cannot be welded to one. The interface that makes a processor swappable could not be designed before the second one existed.
  • A key you did not makeA device fingerprint is a hash the browser computes and the server has to take on faith. The useful question is not whether to trust it, but what a server does once it accepts that it cannot.
  • The template never learns your nameA trainer builds a workout once and runs it for a room of people who are not the same. The data model that survived is three tables with a one-way street between them, and the model it replaced was the obvious one.
  • The copy that heals itselfA marketplace that sells a brand's products keeps a copy of the brand's store. The same codebase keeps that copy two different ways, and the slower one is the one that is right by morning.
  • The ledger was rightA team sale splits one commission between two people. The split was recorded correctly everywhere a person could look, and the code that sent the money would have paid the wrong one.
  • Smaller than it wasOn 27 September the gym's movement library lost 4,724 lines and gained one field. What came out was a theory of how movements relate. What replaced it was a trainer writing the relation down.
  • The toast that could not fireA trainer taps Mark All and the whole room's round is recorded. From October 2025, if every one of those saves failed, the app said nothing, because a failed save and a deliberate skip had become the same value.
  • The ceiling is a thousand rowsA comment beside the member totals names their ceiling: tens of thousands of sets, and then it gets slow. The query under it has no range, and the API it calls stops at a thousand rows without saying so.
  • Spent, but not on anythingEvery deposit required a texted code, and each code could be spent once. Nothing recorded which deposit spent it, so the dispute packet that cited those codes was counting texts, not approvals. Now each spent code carries the checkout it approved.
  • No exceptions notedThe platform could generate a certificate of its own controls for underwriters, and every result in it was the same fixed string. Re-reading it for this page found that. It now counts what the guard actually decided.