Skip to content

Custom dismiss phrase configuration and challenge not blocking dismiss #43

Closed

Description

@kkurtgodel

Hi, thanks for building this app — exactly the kind of thing I was looking for.

I have two questions:

  1. How can I set my own custom text for the "Type a Phrase" dismiss challenge?
    Right now the alarm only shows a pre-set/random phrase (e.g. "Rise and shine, it is time to wake up") when it fires. The README mentions custom phrases are supported, but I can't find where to enter my own phrase in the alarm edit screen or in Settings. Could you point me to where this is configured, or is it not yet exposed in the UI?

  2. The dismiss challenge doesn't seem to actually block dismissal.
    Even after selecting a challenge type (e.g. "Type a Phrase") for an alarm, tapping "Dismiss" on the ringing alarm screen turns off the alarm immediately without requiring me to complete the challenge. I would expect the challenge to be mandatory before the alarm can be dismissed. Is this a bug, or am I missing a setting that enforces the challenge?

Activity

  1. SysAdminDoc commented on Jul 29, 2026

    @SysAdminDoc
    Owner

    Thanks for the kind words, and for two genuinely good catches. Both are fixed and released in v1.15.32.


    2) The challenge doesn't block dismissal — this was a real bug

    Not a missing setting. You found a race.

    The ringing screen renders immediately, but the alarm row is loaded asynchronously (a Room read, plus DataStore, event-stats and weather-cache reads). Until that finished, the UI state had challenge == null, and the dismiss gate read that as "this alarm has no challenge configured":

    val wakeChallengeReady get() = challengeSolved || challenge == null || challengeBypassAvailable

    So Dismiss was live for the entire load window. Tapping it the instant the screen appeared — exactly what anyone does when reaching for a screaming phone — turned the alarm off before the challenge was ever built. Wait a beat and the challenge appears and blocks correctly, which is why it looks inconsistent rather than simply broken.

    Fixed by adding an explicit alarmLoaded flag; the gate now stays locked until the challenge requirement is actually known. Two deliberate carve-outs: the accessibility bypass stays outside the gate, and a failed load fails open — an alarm you can't turn off is far worse than a skipped challenge.

    1) Where to set your own phrase — and why it wasn't working

    The field does exist: Settings → Personalization → Custom typing phrases (one phrase per line). You weren't missing it — it genuinely did nothing.

    ChallengeGenerator.generate() has always merged your phrases into the pool, but the ringing screen called the single-argument overload:

    else -> ChallengeGenerator.generate(type)      // customPhrases defaulted to ""

    So the value was written to storage, round-tripped through backup, and then dropped on the floor at fire time. Type a Phrase and Voice Phrase always drew from the built-in list — hence the pre-set "Rise and shine…" you kept seeing. The setting is now read when the alarm fires and passed through. Your phrases are added to the built-in pool (one is chosen at random per alarm), so if you want only your own text, that's worth a follow-up issue and I'll add an "use only my phrases" toggle.


    Verification

    Both fixes have regression tests that I confirmed fail without the fix. The dismiss gate was also verified on a physical Galaxy S22 Ultra running Android 16: a Type-a-Phrase alarm now fires showing a "Dismiss locked" badge with the Check phrase button disabled until the phrase is typed.

    Grab v1.15.32 and let me know how it behaves for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions