Documentation
¶
Overview ¶
Package mobilelab is MobileLab, the backend of a mobile to-do and habits app, shaped like most mobile backends: remote config and feature flags fetched at launch, a minimum app version, device registration for push, delta sync of the user's items with offline changes, batched analytics events, and a GraphQL endpoint with persisted queries for the home screen. It is the reference app for the mobile-backends pack.
Planted bottlenecks (see README.md), each switched off by a fix flag:
- config: every remote-config request parses the whole config document (300 flags with their targeting rules, about 700 KB) again and evaluates it, and the answer cannot be cached, so a push that makes everyone open the app at once melts the config endpoint (fix "config" parses once, caches the evaluated config per platform, version and rollout bucket, and answers If-None-Match with 304).
- sync: delta sync ignores the client's sync token and sends every item the user has (up to 1,000) on every launch (fix "sync" sends only what changed since the token).
- events: each analytics event is written on its own (200µs) under one global lock, so devices flushing big batches queue behind each other (fix "events" writes each batch at once, outside the lock).
Index ¶
Constants ¶
View Source
const ( // Users is how many accounts MobileLab has (u00001 ... u20000). Users = 20000 // Password is every account's password. Password = "mobilelab-pass" // MinVersion is the oldest app version the API still serves. MinVersion = "3.0.0" // LatestVersion is the newest app version. LatestVersion = "4.2.0" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.