Update, announcement and sunset messaging
Every installed Homefelt app, from the first store build on, can hear “please update”, “the server is down”, “something new” and “this is ending”.
Summary
- One static feed,
https://homefelt.io/app-status/v1.json. It is a file in the repo, deployed by Vercel with the marketing site, so it answers even when the game server is down or not hosted. The schema, examples and selection cases live inspec/app-status/. Swift, Kotlin and the web each implement one pureselect(feed, context)and pass the same cases. - Fail open, and block online play, not the app. An unreachable feed never stops a game. A
protocol break blocks online play only (
"blocks": "online"), because solo and same-screen games are local. Blocking the whole app is kept for the end of a sunset. - TLS, no signature, strict client limits. The feed holds plain text, links to allowlisted hosts and a fixed set of actions. A signature would need an offline key whose loss silences every installed app, and on Android a crypto dependency (minSdk 29 predates platform Ed25519).
- The server enforces later, spec first. From day one the hello carries
client: {platform, app, version, protocol}, which today’s server ignores. Once hosted, the server answersupdateRequired(close 4426) below the minimum. The feed warns, and the server is the backstop. - Messages wait for a safe point: the home screen, the end of a hand or game over. Only a blocking message interrupts, and the game is saved after every move.
Decisions
Eduardo decided these on 2026-11-25.
- Where the feed lives:
https://homefelt.io/app-status/v1.json, deployed with the marketing site. A site rollback also rolls the feed back; the runbook says so. - Integrity: TLS only, no signature, with the strict client limits below.
- Android updates: the
storeaction opens the Play Store listing. No Play In-App Updates (checkpoint 6 is not planned); it can be reconsidered after the first Play release. - Sunset promise: at least 90 days of notice, then 30 days of read-only online play (games in progress finish, none start) with an export of the player’s server data, then the final state. Games on the device keep working throughout.
- “What’s new” comes from the feed (
whatsNew, shown once after an update), so it can be corrected or translated after release. - Who publishes: only Eduardo, through a PR that he merges (
CODEOWNERSon the feed). - Languages: every message carries English and Spanish; the schema rejects a message missing either, and selection falls back to English for any other locale.
- Versions: dates for the apps, semantic versions for the APIs
(decision 0013, issue #226):
- The apps’ marketing version (
MARKETING_VERSION,versionName) is the release day asYYYY.M.D, three integers without leading zeros (2026.12.3). Apple requires at most three period-separated non-negative integers, and the feed’sversionsranges compare the three parts as numbers, so date order is version order. A second store release on the same day takes the next day’s date. - The build number (
CURRENT_PROJECT_VERSION,versionCode) isYYYYMMDDNN,NNthe build of that day from01(2026120301). It always increases, as both stores require, and stays below Google Play’sversionCodelimit of 2,100,000,000 until the end of 2099. - The CLI/server protocol and the feed schema carry semantic versions
MAJOR.MINOR.PATCH. A change that an older client cannot handle (a removed or renamed field, a new required field, a changed meaning) bumps MAJOR; an addition old clients safely ignore bumps MINOR; a fix with no shape change bumps PATCH. The feed URL carries the schema’s major (v1.json). - The server’s
updateRequired(checkpoint 7) refuses a hello when itsclient.protocolmajor differs from the server’s, or whenclient.version, compared as a date version, is below that platform’s minimum inHOMEFELT_MIN_CLIENT_VERSIONS.
- The apps’ marketing version (
Use cases
| Use case | Kind | Severity | Shape |
|---|---|---|---|
| Soft update | update |
warning |
versions below the latest; action store; daily |
| Required update (protocol break) | update |
blocking |
below the minimum; blocks: online; matches the server’s 4426 |
| Maintenance | maintenance |
warning |
all versions, starts and ends; online play greyed out |
| Announcement (new game, rule change) | announcement |
info |
once, optional link |
| Sunset | sunset |
info, warning, blocking |
dated messages plus a flag (below) |
| Kill switch | none | none | a flag, not a message, optionally with one |
| What’s new | whatsNew |
info |
trigger: afterUpdate, once, never after a fresh install |
A sunset of a game, an app version or the whole service runs in four dated stages:
- Advance notice, 90 days or more before:
info, shown once, saying what ends and when. - Read-only, 30 days:
warning, shown daily, and thenewOnlineTablesflag off, so games in progress finish but none start. Once the server can export results, its action links to a homefelt.io page about it. - Final state:
blocking,blocks: "online", with noends, so clients keep it cached. The text says “Games on this phone still work, and your saved game stays here.” - App retired: only then does
blocks: "app"appear.
The feed
The live file is site/public/app-status/v1.json, which Astro copies as is. A change that breaks
old clients goes to v2.json, served beside v1 for as long as v1 clients exist.
{ "schema": "1.0.0", "messages": [ { "id": "canasta-online-1-3", "revision": 1, "kind": "update", "severity": "blocking", "blocks": "online", "target": { "platforms": ["ios", "android"], "apps": ["canasta"], "versions": { "below": "2027.3.1" } }, "starts": "2027-04-01T08:00:00Z", "text": { "en": { "title": "Please update Canasta", "body": "To keep playing with friends online, install the new version. Games on this phone still work.", "action": "Update" }, "es": { "title": "Actualiza Canasta", "body": "Para seguir jugando en línea con tus amigos, instala la nueva versión. Las partidas en este teléfono siguen funcionando.", "action": "Actualizar" } }, "action": { "kind": "store" }, "repeat": "everyLaunch" } ], "flags": [ { "id": "newOnlineTables", "enabled": false, "target": { "apps": ["canasta"] }, "starts": "2027-04-01T08:00:00Z" } ]}Fields (spec/app-status/README.md pins each one):
idandrevision: dismissals are stored perid@revision; bump the revision to show it again.kind:update,maintenance,announcement,sunsetorwhatsNew.severity:info,warningorblocking.blocks:onlineorapp, on blocking messages only.target; a field left out matches everything.platforms:ios,androidorweb.apps: game ids from the registry (canasta). On the web, the message shows on that game’s pages only.versions:{ "from": "2026.12.1", "below": "2027.3.1" }, inclusive then exclusive. This is a plain range rather than npm syntax, so three platforms parse it alike: one to three decimal parts, missing parts 0, no pre-release tags.locales: language tags, matched by language (esmatcheses-MX).
startsandends: optional, RFC 3339 UTC, compared with the device clock. A message past itsendsis dropped, even from the cache.text: language tag to{ title, body, action? }, withenrequired. The fallback runs from the exact tag to the language toen, the chain in the parallel i18n plan. The title is at most 60 characters and the body 280, as plain text with no markup.action.kind:storeopens the platform’s own store page, which the app knows.linkopens anhttps://URL onhomefelt.ioorplay.homefelt.ioonly.continuecloses the message.- Each kind has a default label in the app, so
text.*.actionis optional.
repeat:once,dailyoreveryLaunch. Blocking messages cannot be dismissed.trigger: "afterUpdate"shows a message only when the previous launch ran an older version.flags:{ id, enabled, target?, starts?, ends? }. Each app compiles in the flags it knows, with defaults (onlinePlay,newOnlineTables,invites), and ignores unknown ids.
Two levels of strictness. spec/app-status/schema.json (JSON Schema 2020-12) is strict for
authors: additionalProperties: false, the enums, the lengths, an en text and a valid URL.
Clients are lenient, so the format can grow:
- they ignore unknown fields;
- they skip a message whose
kind,severity,blocksoraction.kindthey do not know; - they treat a feed over 64 KiB, or with a
schemaother than1.x.y, as unreachable.
The exact rules are in spec/app-status/README.md (#228), which wins where this plan is less precise.
Spec layout, following the existing invalid/ pattern:
spec/app-status/ README.md fields, selection rules, wording rules with good and bad examples schema.json authoring schema examples/*.json one valid feed per use case (soft, required, maintenance, sunset-*, kill, whats-new) cases/*.json { "feed": "examples/sunset-final.json", "context": { "platform": "android", "app": "canasta", "version": "2027.2.14", "previousVersion": "2027.2.1", "locale": "es-MX", "now": "2027-04-02T10:00:00Z", "dismissed": { "x@1": "2027-04-01T10:00:00Z" } }, "expect": { "blocking": "canasta-online-1-3", "banner": null, "sheet": null, "flags": { "newOnlineTables": false }, "language": "es" } }spec/invalid/app-status/*.json each breaks one rule; expected.json gives the failure textSelection:
- Filter by target and dates, and drop dismissed messages.
- The first blocking message, in feed order, wins.
- Otherwise there is at most one banner (
warning) and one sheet (info), each the latest bystarts.
It is platform code, named for Homefelt (architecture.md):
- Swift: a Foundation-only
HomefeltStatustarget withAppStatus.swift. - Kotlin: a JVM module,
kotlin/status, withAppStatus.kt. - Web:
web/src/status/appStatus.ts.
Integrity: TLS or a signed payload
| TLS only (decided) | TLS plus an Ed25519 signature | |
|---|---|---|
| On-path tampering | stopped (App Transport Security; https only on Android) | stopped |
| A hijacked Vercel, GitHub or DNS account | not stopped | stopped while the key stays offline |
| Cost | none | an offline key, signing before each commit, two embedded public keys for rotation; on Android 29–32 Tink or Bouncy Castle, since Signature has Ed25519 from API 33 |
| Worst failure | a bad feed until the next deploy (minutes) | a lost key: no installed app can be told anything again |
CryptoKit verifies Ed25519 from iOS 13, so iOS would be cheap. Android would not, and the key would
be a single point of failure for a mechanism whose job is to work at the end. I recommend TLS only
for v1, with the clients capping the harm: text only, allowlisted links, no remote images, and
blocks: "app" honoured only on sunset messages. Whoever can hijack the deploy can already replace
the web game. Revisit if the feed moves to a third-party CDN or others get merge rights; a signed
feed would be v2.json.
Client behaviour
- Fetch on launch and on return to the foreground, at most every 15 minutes, in the background. The first screen never waits for it.
- Cache the last good body with its
ETag, and sendIf-None-Match; a 304 keeps the cache. Vercel serves static files from its CDN for the life of a deployment. Confirm withcurl -sIafter the first deploy that it sends anETag; without one, it is a plain GET of a few KB.- iOS: an ephemeral
URLSessionof the feed’s own, neverURLSession.shared. - Android: OkHttp, a client derived with
newBuilder()from the app’s oneOkHttpClient. - Web:
fetchwithcredentials: "omit". - Each platform’s network layer and the feed’s
StatusClient: decision 0015 (SwiftHomefeltNet, Kotlinkotlin/net, webweb/src/net).
- iOS: an ephemeral
- Timeout budget: 3 seconds to connect, 5 in total, no retries. A failure leaves the cache as it is.
- Fail open. No feed and no cache means no messages and the compiled flag defaults. A cache
applies when the fetch fails, including a cached blocking message until its
ends, so a phone offline after a sunset still shows the final state. - No tracking. A bare GET with no query, no cookies and
User-Agent: Homefelt, because Android’s default user agent names the device model. Targeting happens on the device. Vercel still sees the IP, so add a line tosite/src/pages/privacy.astroand the Play data-safety form. - Android needs
INTERNET. The manifest has none today. It is a normal permission, with no prompt. - Test hooks, Debug only, after
CANASTA_UI_TEST_SEEDandUiTestLaunch:HOMEFELT_STATUS_FEED(a fixture path fromspec/app-status/examples; the UI tests pass the feed itself inHOMEFELT_STATUS_FEED_TEXT, since a simulator app cannot open files on an external volume) andHOMEFELT_STATUS_NOW;HOMEFELT_STATUS_URL, for a Vercel branch preview;HOMEFELT_STATUS_FRESH(a first launch),HOMEFELT_STATUS_PREVIOUS_VERSIONandHOMEFELT_STATUS_VERSION;- on Android the UI tests set the same through
UiTestStatus(a feed read from the test APK’s assets, which carryspec/app-status); - on the web, Playwright’s
page.routeserves the fixtures.
- A server 4426 shows the same “update to play online” view, with text built into the app.
Server-side enforcement (future protocol change, spec first)
The hello (spec/protocol/server.md) already ignores unknown fields, so clients send this from their first release:
{"type":"hello","token":"<access token>","client":{"platform":"ios","app":"canasta","version":"2027.2.1","protocol":"1.0.0"}}Once the server is hosted (#50), the spec adds:
{"type":"error","error":{"kind":"client","code":"updateRequired","message":"updateRequired", "context":{"platform":"ios","minimum":"2027.3.1"}}}- A new error kind,
client, and close code 4426 (after HTTP 426 Upgrade Required). HOMEFELT_MIN_CLIENT_VERSIONS=ios=2027.3.1,android=2027.3.1. A platform left out has no minimum, as the always-latest web does.- A hello with no
clientis refused withupdateRequired(decided in #233: the web ships with the server and the apps sendclientfrom their first store build, so no switch is needed). - Optionally, a
Homefelt-Clientheader on the HTTP endpoints gets 426, so an old app learns before it creates a table.
How it fits with the feed. The feed warns early and reaches offline phones; the server is the gate for whoever missed it. The runbook order:
- Ship in both stores.
- Warn for two weeks.
- Publish the blocking message.
- Raise the minimum the same day, never before App Review has passed.
Store-native options
Decided: the store link only on both platforms (decision 3). The Play option is kept here for when it is reconsidered.
- Android: Play In-App Updates (not planned) (
com.google.android.play:app-updateand-ktx2.1.0).AppUpdateManager.appUpdateInforeportsUPDATE_AVAILABLE, andstartUpdateFlowForResultrunsIMMEDIATE(full screen; Play installs and restarts) orFLEXIBLE(background download, thencompleteUpdate()).- Priority is set only through the Play Developer API.
- It works only for Play installs and is tested through internal app sharing.
- The feed stays the authority: the
storeaction startsFLEXIBLEfor a warning andIMMEDIATEfor a blocking message when Play offers an update, and opens the listing otherwise.
- iOS has no update API.
SKStoreProductViewControllershows a store page but cannot check for or force an update. Thestoreaction openshttps://apps.apple.com/app/id<appleId>withopenURL, so the in-app message plus a store link is the whole mechanism.
The web
- Same feed, platform
web.site/vercel.jsongives/app-status/(.*)four headers:Content-Type: application/json; charset=utf-8,Cache-Control: public, max-age=60,Access-Control-Allow-Origin: *(public data, read fromplay.and from web previews) andX-Content-Type-Options: nosniff. - Reload check.
- A small Vite plugin writes
dist/version.json({ "build": "<commit sha>" }) and defines the same id in the bundle;web/vercel.jsonserves the file withno-cache. - The tab checks it on becoming visible and every 30 minutes. At the next safe point it says: “Homefelt has been updated. Reload to get the new version.”
- Reloading is safe: the solo game is saved after every move, and an online seat returns with the next hello.
- A small Vite plugin writes
- Lazy chunks. A tab opened before a deploy can fail to
import()the game’s engine, so it handles Vite’svite:preloadErrorby reloading. - Not Skew Protection. It needs Pro, does not support Vite, and never tells a tab that a new version exists.
Authoring and publishing
- Edit
site/public/app-status/v1.json, which starts as{"schema":"1.0.0","messages":[],"flags":[]}. Copy entries fromspec/app-status/examples/. - Check with
bin/test app-status, whichbin/test sitealso runs. It validates the feed and examples against the schema withspec/behaviour/app-status.ts(no dependencies), and checks that eachendsfollows itsstarts, that ids are unique and that link hosts are allowed. - Preview (from #230) with
bin/app-status preview --platform android --version 2027.2.1 --locale es --now 2027-04-02, which prints what that client would show, using the web’sselect.- For the look on the web:
npm run devinweb/with?statusFeed=, in dev builds only. - On native: a Debug build with
HOMEFELT_STATUS_FEED.
- For the look on the web:
- Who publishes: whoever merges to
main, which means Eduardo. AddCODEOWNERSforsite/public/app-status/andspec/app-status/. An emergency is a feed-only PR. - Caveat: an Instant Rollback of the
homefeltproject rolls the feed back too.
UI
- Banner (
warning): in the layout at the top of the home and hand-score screens, never an overlay. It has one action, plus “Not now” when it can be dismissed. - Sheet (
info): SwiftUI.sheetor ComposeModalBottomSheet, with scrolling content. - Blocking view: for
onlineit replaces the online entry points, and solo play stays. Forappit replacesAppView’s content, with no close button and no swipe to dismiss. - Large text: the theme’s
textSizesand its large set, as elsewhere. Nothing is truncated, everything scrolls, and buttons stack at large sizes, at leastTheme.Control.buttonHeightStandardtall. - VoiceOver and TalkBack:
- titles are headings (
.isHeader,semantics { heading() }); - a new banner is announced politely (
AccessibilityNotification.Announcement,liveRegion = Polite); - a blocking view takes focus on its title;
- severity is a word (“Important”), never colour alone;
- a link says where it goes.
- titles are headings (
- Never mid-hand. Non-blocking messages queue until the home screen, the hand score or game over.
- Wording for older players:
- Say first what happens to their game.
- One idea per sentence, one action.
- Write dates out (“Thursday 1 April”).
- No version numbers, “server”, “protocol” or “error”.
- No exclamation marks, capitals or countdowns.
- Reassure: “Your saved game is safe.”
Phased plan
Each checkpoint is one issue and one PR. Before any of them reaches a store build, both apps switch to date versions (#226).
- Spec (M), #228:
spec/app-status/with the README, schema, examples, cases and invalid files. - Feed hosting (S), #229:
- the empty live feed;
- the
site/vercel.jsonheaders; bin/test app-statuschecking the live file, and CODEOWNERS for the feed and its spec.
- Selection on three platforms (M), #230:
HomefeltStatus,kotlin/statusandweb/src/status, each passing every case, andbin/app-status preview, which needs the web’sselect. - Native client, day one, before the first store release (L), #231:
- fetch, cache and timeout;
- Android
INTERNET; - the banner, sheet and blocking views in both apps;
- the Debug hooks, and UI tests for soft update, required update, maintenance and sunset;
- the privacy page line;
clientin every hello, once the apps have a server client.
- Web (M), #232: feed messages, the reload banner and
vite:preloadError, with Playwright checks, on the web’s network layer and per-service clients (decision 0015; web/README.md “Network and app-status messages”). - Play In-App Updates: not planned (decision 3).
- Server enforcement (M), once hosted (#50), #233: the spec, then
canasta-server, then each client’s 4426 handling. - Runbook (S), #234:
docs/app-status.mdfor an update, maintenance and a sunset.
Open questions
All eight were answered by Eduardo on 2026-11-25 and are recorded under Decisions.
Sources (opened 2026-11-23; versioning rules opened 2026-11-25):
- Apple:
CFBundleShortVersionStringandCFBundleVersion - Android: Version your app (
versionCodeat most 2,100,000,000 on Google Play) - Semantic Versioning 2.0.0
- Play In-App Updates: overview, Kotlin and testing
- Android
Signature - CryptoKit
isValidSignature SKStoreProductViewController- Vercel: CDN cache and Skew Protection
- Vite load error handling