Answer push_off before no_subscriptions and give every iOS browser the Home Screen copy (Feature 19)
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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user