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
+14 -1
View File
@@ -291,8 +291,21 @@ func TestTestPushAPI(t *testing.T) {
svc, st, _ := newTestPushWith(t)
router := newPushRouter(t, svc)
// With no device subscribed there is nothing to test.
// With push off for plan_ready and no device subscribed, push off is
// what the test says.
if _, err := st.Writer.Exec(`UPDATE notification_prefs SET push = 0 WHERE event = 'plan_ready'`); err != nil {
t.Fatal(err)
}
rec, body := serve(t, router, signedIn(http.MethodPost, testPushPath, nil))
if rec.Code != http.StatusConflict || body["error"].(map[string]any)["code"] != "push_off" {
t.Errorf("POST with push off and no subscriptions = %d %s, want 409 push_off", rec.Code, rec.Body)
}
if _, err := st.Writer.Exec(`UPDATE notification_prefs SET push = 1 WHERE event = 'plan_ready'`); err != nil {
t.Fatal(err)
}
// With no device subscribed there is nothing to test.
rec, body = serve(t, router, signedIn(http.MethodPost, testPushPath, nil))
if rec.Code != http.StatusConflict || body["error"].(map[string]any)["code"] != "no_subscriptions" {
t.Errorf("POST with no subscriptions = %d %s, want 409 no_subscriptions", rec.Code, rec.Body)
}