C.W.K.
Stream
Lesson 04 of 04 · published

Remember the Choice, Never Fake It

~9 min · persistence, default-profile, fail-loud

Level 0Silent
0 XP0/36 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete
"Restore the exact profile you chose — or ask again. Never speak in a voice you didn't pick."

Persist the Explicit Choice

When you Speak with a profile, Bellows remembers it — it writes that profile as your default_profile. Come back after navigating away, reloading the page, or even restarting the service, and your last choice is waiting. Small thing, but it removes the tiny re-selection tax on every single use.

The word that matters is explicit. Bellows persists the profile you deliberately selected and spoke with — not one you brushed past in a dropdown. Restoring an accident is worse than restoring nothing, because it looks intentional.

Restore Only If It's Really There

Here's the sharp edge: a saved profile is only restored when that exact profile is available on the currently active account. Switch accounts, retire a binding, and your saved profile might not exist here anymore. At that fork, Bellows does not reach for the nearest voice that would work. It restores nothing and asks. A missing binding is an explicit unavailable state — the same fail-loud rule you'll meet head-on in Track 3.

Why the Silent Swap Is the Bug

Imagine the convenient version: your saved voice is gone, so the engine quietly speaks in whichever profile is closest. Now a private message goes out in the wrong voice, and nothing warned you. The whole point of persisting a choice is fidelity to that choice; a substitution that betrays it is worse than never remembering at all.

Code

Restore-if-available, otherwise ask·typescript
// Restore the last EXPLICIT choice -- but only if it truly exists here.
function resolveStartupProfile(
  saved: string | null,
  account: Account,
): Profile | null {
  if (!saved) return null;                     // nothing chosen yet
  const profile = account.bindings.get(saved); // exact match, active account
  return profile ?? null;                      // NOT available -> null, never a swap
}

// null means the UI asks you to choose again.
// It never quietly speaks in someone else's voice to be 'helpful'.

External links

Exercise

Find a setting your app or a tool you use 'restores' on startup. Ask two questions: is it restoring a deliberate choice or an accidental one, and what does it do when the restored thing no longer exists? If the answer to the second is 'silently picks something else,' you've found a fidelity bug waiting to embarrass someone.
Hint
The dangerous case is never the happy restore. It's the restore where the saved value is gone — and the code chose convenience over honesty.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.