Answer push_off before no_subscriptions and give every iOS browser the Home Screen copy (Feature 19)
CI / ci (push) Successful in 6m17s
CI / ci (pull_request) Successful in 7m26s

SendTest now reads the plan_ready push preference before the stored
subscriptions, so with push off and no device subscribed the test-push
endpoint answers 409 push_off rather than 409 no_subscriptions.

Onboarding step 3's unsupported result now gives the Home Screen guidance
in any iOS browser, not only Safari. isIos in InstallHint.tsx is the one
check for iPhone, iPod and iPad; isIosSafari builds on it and InstallHint
itself stays Safari-only.

Task f89279b8-b92c-4d9f-a6c2-fd87fccda509

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-09 17:17:58 -04:00
co-authored by Claude Opus 5.5
parent 875a0faaae
commit 3ce0935b52
7 changed files with 88 additions and 22 deletions
+17
View File
@@ -306,3 +306,20 @@ func TestSendTestWithPushOff(t *testing.T) {
t.Fatalf("rows = %+v, want none", rows)
}
}
// Push off is reported before the subscriptions are looked at, so with
// both push off and no device subscribed the answer is push off.
func TestSendTestWithPushOffAndNoSubscriptions(t *testing.T) {
t.Parallel()
svc, st := newTestService(t)
if _, err := st.Writer.Exec(`UPDATE notification_prefs SET push = 0 WHERE event = 'plan_ready'`); err != nil {
t.Fatal(err)
}
_, err := svc.SendTest(context.Background())
if !errors.Is(err, notify.ErrPushOff) || errors.Is(err, ErrNoSubscriptions) {
t.Fatalf("SendTest = %v, want notify.ErrPushOff", err)
}
if rows := notifytest.Rows(t, st, notify.PlanReady); len(rows) != 0 {
t.Fatalf("rows = %+v, want none", rows)
}
}