Urgent.News

What's breaking now, across thousands of outlets.

Tech

Backend API Feature Flags: Percentage User Targeting for Checkout Cost Attribution

Short answer: keep checkout flag evaluation on the backend, assign each account to a deterministic cohort, and record the flag key, revision, and cohort beside every failed checkout. Use polling to refresh configuration, but let the last validated snapshot survive a control-plane outage. This gives a small SaaS team simple percentage releases without letting a browser choose who receives…

Backend API feature flags enable percentage user targeting for checkout cost attribution without placing account identity into client-controlled requests. The backend assigns each account to a deterministic cohort and records the flag key, revision, and cohort alongside every failed checkout. Configuration polling refreshes the setup, with the most recent validated snapshot surviving a control-plane outage.

This approach allows a small SaaS team to perform simple percentage releases without letting a browser decide who experiences payment-path behavior.

A global error-rate graph may indicate that checkout performance declined, but it cannot pinpoint whether new paths caused failures for high-volume accounts or how much those failures cost the business. Therefore, the flag decision must become part of operational evidence, while keeping account identity out of client-controlled requests. The backend API should handle feature flags and percentage rollouts by treating them as allocation rules rather than explanations.

When a checkout_v2 moves from 5% to 20%, and declined payments increase, the evaluated variant and stable account bucket per failure are necessary to separate rollout exposure from processor issues or tenant-specific integrations. A compact failure record containing an internal account identifier, order identifier, flag revision, assigned variant, failure class, and integer amount in minor currency units should be used.

The revision and unit matter, and both signals should be considered when defining alerts in SLO terms. User targeting should use immutable server-known attributes like account ID, plan, or an explicit allowlist, rather than trusting a React client to announce its own cohort.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Why a missing JavaScript file can stay missing after you deploy it

I built cachewhy around a small but costly HTTP cache mistake. Imagine a request for /missing.js that returns 404 with Cache-Control: public, max-age=2678400 . That lifetime is 31 days.

  • Missing JavaScript file persists due to long-lived HTTP cache.
  • Browser stores 404 response in private and shared caches.
  • Cachewhy tool reveals cache details and caching behavior.

I built CompressGIF: local GIF compression, plus REST and MCP APIs

A GIF can be useful in a README, bug report, or product demo—and still be too large to attach. Getting it below an upload limit often means trying compression settings, checking the animation, and…

  • CompressGIF tool compresses GIF files for documentation and demos
  • Browser compressor offers quality, size, or size-target modes
  • REST API provides asynchronous compression service for developers

Credit Clinic explores the consequences of one film credit

This is a submission for the Sanity Challenge, Path Two: Vibe-Code Something Strange . What I Built Credit Clinic is a reference-impact lab for people learning how connected content behaves.

  • Removing Ridley Scott's credit from Alien affects five other films
  • Renaming the person preserves all linked films without changes
  • Tool maintains reference structure for shared dependencies

More from Saturday 3 October →