mobilelab

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

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

func New

func New(cfg labkit.Config) http.Handler

New returns MobileLab's handler.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL