From 9d4fb16ef8b388f930c3bdacd0ed94cb69627fd4 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 05:40:35 +0000 Subject: [PATCH 1/4] WIP hardening: admin test push, ad manager, step-up, security events, bulk moderation, import cleanup, update notifications, SEO files Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01NrPV5wwqB6Kvn6Jo16iwcb --- next.config.ts | 5 +- .../migration.sql | 29 +++++++ prisma/schema/admin.prisma | 2 + prisma/schema/catalog.prisma | 4 + prisma/schema/growth.prisma | 2 + prisma/schema/security.prisma | 22 +++++ src/app/(public)/account/layout.tsx | 5 +- src/app/(public)/app/[slug]/page.tsx | 17 +++- src/app/(public)/apps/page.tsx | 4 +- src/app/(public)/c/[slug]/page.tsx | 4 +- src/app/(public)/page.tsx | 13 +-- src/app/(public)/search/page.tsx | 12 ++- src/app/admin-host/(portal)/admins/page.tsx | 2 + src/app/admin-host/(portal)/imports/page.tsx | 28 ++++++- src/app/admin-host/(portal)/push/page.tsx | 47 +++++++++-- src/app/admin-host/(portal)/security/page.tsx | 2 + .../admin-host/(portal)/submissions/page.tsx | 39 ++++++--- src/app/api/auth/[...all]/route.ts | 11 ++- src/app/api/cron/tick/route.ts | 3 + src/app/api/push/test/route.ts | 29 ------- src/app/api/search/suggest/route.ts | 2 + src/app/api/site-verification/route.ts | 20 +++++ .../(portal)/listings/[id]/page.tsx | 1 + src/components/account/account-nav.tsx | 17 +++- src/components/ads/ad-slot.tsx | 62 ++++++++++++-- src/components/ads/ad.tsx | 37 ++++++-- src/components/portal/bulk-form.tsx | 7 +- src/components/portal/settings-form.tsx | 4 +- src/components/portal/step-up-card.tsx | 26 ++++++ .../portal/submissions-bulk-form.tsx | 63 ++++++++++++++ src/components/push-toggle.tsx | 14 +--- src/components/ui/action-form.tsx | 4 +- src/components/ui/step-up-input.tsx | 14 ++++ src/lib/push-client.ts | 9 -- src/proxy.ts | 4 + src/server/actions/admin.ts | 83 +++++++++++++++++- src/server/actions/developer.ts | 2 +- src/server/actions/settings.ts | 8 +- src/server/admin/auth.ts | 39 ++++++++- src/server/admin/step-up.ts | 45 ++++++++++ src/server/ads/manager.ts | 57 +++++++++++++ src/server/ads/placements.ts | 3 +- src/server/community/notifications.ts | 23 +++-- src/server/importer/bulk.ts | 14 +++- src/server/importer/cleanup.ts | 44 ++++++++++ src/server/importer/dedupe.ts | 10 ++- src/server/importer/importer.ts | 1 + src/server/jobs/handlers.ts | 9 +- src/server/listings/bulk-moderation.ts | 84 +++++++++++++++++++ src/server/listings/changes.ts | 54 ++++++++++++ src/server/listings/workflow.ts | 40 +++++++-- src/server/push/diagnostics.ts | 9 ++ src/server/push/push.ts | 15 ++-- src/server/rate-limit.ts | 8 +- src/server/security/bots.ts | 54 ++++++++++++ src/server/security/events.ts | 24 ++++++ src/server/settings/registry.ts | 15 +++- tests/db/production-repair.test.ts | 17 ++-- 58 files changed, 1077 insertions(+), 145 deletions(-) create mode 100644 prisma/migrations/20261115120000_hardening_security_events/migration.sql delete mode 100644 src/app/api/push/test/route.ts create mode 100644 src/app/api/site-verification/route.ts create mode 100644 src/components/portal/step-up-card.tsx create mode 100644 src/components/portal/submissions-bulk-form.tsx create mode 100644 src/components/ui/step-up-input.tsx create mode 100644 src/server/admin/step-up.ts create mode 100644 src/server/ads/manager.ts create mode 100644 src/server/importer/cleanup.ts create mode 100644 src/server/listings/bulk-moderation.ts create mode 100644 src/server/listings/changes.ts create mode 100644 src/server/security/bots.ts create mode 100644 src/server/security/events.ts diff --git a/next.config.ts b/next.config.ts index daa0b84..e694500 100644 --- a/next.config.ts +++ b/next.config.ts @@ -42,7 +42,10 @@ const nextConfig: NextConfig = { { key: "X-Content-Type-Options", value: "nosniff" }, { key: "Referrer-Policy", value: "strict-origin-when-cross-origin" }, { key: "X-Frame-Options", value: "DENY" }, - { key: "Permissions-Policy", value: "camera=(), microphone=(), geolocation=(), payment=(), usb=()" }, + // Isolates Webcenta's windows from pages it opens (ads, OAuth providers use full redirects, not popups). + { key: "Cross-Origin-Opener-Policy", value: "same-origin" }, + { key: "X-Permitted-Cross-Domain-Policies", value: "none" }, + { key: "Permissions-Policy", value: "camera=(), microphone=(), geolocation=(), payment=(), usb=(), serial=(), hid=(), bluetooth=(), magnetometer=(), gyroscope=(), accelerometer=(), display-capture=()" }, ...(process.env.NODE_ENV === "production" ? [{ key: "Strict-Transport-Security", value: "max-age=31536000; includeSubDomains" }] : []), diff --git a/prisma/migrations/20261115120000_hardening_security_events/migration.sql b/prisma/migrations/20261115120000_hardening_security_events/migration.sql new file mode 100644 index 0000000..a7df3b4 --- /dev/null +++ b/prisma/migrations/20261115120000_hardening_security_events/migration.sql @@ -0,0 +1,29 @@ +-- AlterTable +ALTER TABLE `AdminSession` ADD COLUMN `stepUpAt` DATETIME(3) NULL; + +-- AlterTable +ALTER TABLE `ImportCandidate` ADD COLUMN `duplicateOfListingId` VARCHAR(191) NULL; + +-- AlterTable +ALTER TABLE `ListingRevision` ADD COLUMN `changeSummary` VARCHAR(300) NULL, + ADD COLUMN `changedFields` JSON NULL; + +-- CreateTable +CREATE TABLE `SecurityEvent` ( + `id` VARCHAR(191) NOT NULL, + `type` VARCHAR(40) NOT NULL, + `severity` VARCHAR(10) NOT NULL DEFAULT 'info', + `source` VARCHAR(191) NOT NULL, + `detail` VARCHAR(500) NULL, + `hour` DATETIME(3) NOT NULL, + `count` INTEGER NOT NULL DEFAULT 1, + `firstAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), + `lastAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), + `alertedAt` DATETIME(3) NULL, + + INDEX `SecurityEvent_hour_idx`(`hour`), + INDEX `SecurityEvent_type_hour_idx`(`type`, `hour`), + UNIQUE INDEX `SecurityEvent_type_source_hour_key`(`type`, `source`, `hour`), + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + diff --git a/prisma/schema/admin.prisma b/prisma/schema/admin.prisma index 8d0cba6..d455982 100644 --- a/prisma/schema/admin.prisma +++ b/prisma/schema/admin.prisma @@ -81,6 +81,8 @@ model AdminSession { ipAddress String? userAgent String? @db.Text revokedAt DateTime? @db.DateTime(3) + /// Last time the administrator re-confirmed with an authenticator code (sensitive actions). + stepUpAt DateTime? @db.DateTime(3) createdAt DateTime @default(now()) @db.DateTime(3) admin AdminUser @relation(fields: [adminId], references: [id], onDelete: Cascade) diff --git a/prisma/schema/catalog.prisma b/prisma/schema/catalog.prisma index 982ff8e..2817b1d 100644 --- a/prisma/schema/catalog.prisma +++ b/prisma/schema/catalog.prisma @@ -351,6 +351,10 @@ model ListingRevision { data Json /// Reviewer-visible notes from the submitter. submitterNotes String? @db.Text + /// Developer's public "what changed" summary (shown to users who saved the app). + changeSummary String? @db.VarChar(300) + /// Fields that differ from the previously approved version (set on approval). + changedFields Json? submittedById String? submittedAt DateTime? @db.DateTime(3) reviewedById String? diff --git a/prisma/schema/growth.prisma b/prisma/schema/growth.prisma index b9708e4..77ac947 100644 --- a/prisma/schema/growth.prisma +++ b/prisma/schema/growth.prisma @@ -115,6 +115,8 @@ model ImportCandidate { failedStage String? @db.VarChar(40) errorCategory String? @db.VarChar(40) retryable Boolean @default(true) + /// The existing listing this import duplicates (set by duplicate detection; never published). + duplicateOfListingId String? createdByAdminId String? createdAt DateTime @default(now()) @db.DateTime(3) processedAt DateTime? @db.DateTime(3) diff --git a/prisma/schema/security.prisma b/prisma/schema/security.prisma index ea27b1b..889714b 100644 --- a/prisma/schema/security.prisma +++ b/prisma/schema/security.prisma @@ -155,3 +155,25 @@ model MonitoringPolicy { allowAutoApproval Boolean @default(false) updatedAt DateTime @updatedAt @db.DateTime(3) } + +/// Security-relevant activity (failed sign-ins, lockouts, rate limiting, permission denials, +/// new-device admin sign-ins, blocked requests), counted per type, source and hour so a flood +/// produces one row, not millions. Never contains passwords, tokens or cookies. Kept 90 days. +model SecurityEvent { + id String @id @default(uuid(7)) + type String @db.VarChar(40) + severity String @default("info") @db.VarChar(10) + /// Source: an IP address, an account id or a rate-limit scope (no secrets). + source String @db.VarChar(191) + detail String? @db.VarChar(500) + hour DateTime @db.DateTime(3) + count Int @default(1) + firstAt DateTime @default(now()) @db.DateTime(3) + lastAt DateTime @default(now()) @db.DateTime(3) + /// An alert email was sent for this row. + alertedAt DateTime? @db.DateTime(3) + + @@unique([type, source, hour]) + @@index([hour]) + @@index([type, hour]) +} diff --git a/src/app/(public)/account/layout.tsx b/src/app/(public)/account/layout.tsx index 46245f9..68ec888 100644 --- a/src/app/(public)/account/layout.tsx +++ b/src/app/(public)/account/layout.tsx @@ -1,5 +1,5 @@ import type { Metadata } from "next"; -import { AccountBackLink, AccountNav } from "@/components/account/account-nav"; +import { AccountBackLink, AccountBreadcrumb, AccountNav } from "@/components/account/account-nav"; import { developerOrigin } from "@/lib/hosts"; import { requireUser } from "@/server/auth/session"; import { unreadCount } from "@/server/community/notifications"; @@ -16,12 +16,13 @@ export default async function AccountLayout({ children }: { children: React.Reac const unread = await unreadCount(user.id); return (
-
diff --git a/src/app/(public)/app/[slug]/page.tsx b/src/app/(public)/app/[slug]/page.tsx index bf22ce8..a6cf9b5 100644 --- a/src/app/(public)/app/[slug]/page.tsx +++ b/src/app/(public)/app/[slug]/page.tsx @@ -202,12 +202,23 @@ export default async function AppPage({ params, searchParams }: Props) { )} - {/* Separated from the app's own content by its label and spacing; never next to the Visit button. */} - + {/* Closing call to action after the app's own information. The compact sponsored unit sits + between them, labelled and boxed so it can never be mistaken for this app's content; + the button at the top of the page has no ad near it. */} +
+

Ready to try {listing.name}?

+ +
+ Visit official website +

Opens {domain} · you’ll see a notice before leaving Webcenta

+
+
+ + diff --git a/src/app/(public)/apps/page.tsx b/src/app/(public)/apps/page.tsx index d2e2058..d423205 100644 --- a/src/app/(public)/apps/page.tsx +++ b/src/app/(public)/apps/page.tsx @@ -1,6 +1,6 @@ import type { Metadata } from "next"; import Link from "next/link"; -import { Ad } from "@/components/ads/ad"; +import { AdBanner } from "@/components/ads/ad"; import { CategoryIcon } from "@/components/category-icon"; import { StoreListSection } from "@/components/store-sections"; import { EmptyState } from "@/components/states"; @@ -47,7 +47,7 @@ export default async function AppsPage() { <> -
+ {FEATURED_CATEGORIES.map((slug, i) => )} )} diff --git a/src/app/(public)/c/[slug]/page.tsx b/src/app/(public)/c/[slug]/page.tsx index de5c178..8fdd309 100644 --- a/src/app/(public)/c/[slug]/page.tsx +++ b/src/app/(public)/c/[slug]/page.tsx @@ -3,7 +3,7 @@ import Link from "next/link"; import { notFound } from "next/navigation"; import { ChevronRight } from "lucide-react"; import { CategoryIcon } from "@/components/category-icon"; -import { Ad } from "@/components/ads/ad"; +import { AdBanner } from "@/components/ads/ad"; import { FilterBar } from "@/components/filter-bar"; import { Pagination } from "@/components/pagination"; import { CardGrid } from "@/components/rail"; @@ -82,7 +82,7 @@ export default async function CategoryPage({ params, searchParams }: Props) { ) : ( )} -
+ ); diff --git a/src/app/(public)/page.tsx b/src/app/(public)/page.tsx index 94913c9..b4da671 100644 --- a/src/app/(public)/page.tsx +++ b/src/app/(public)/page.tsx @@ -1,6 +1,7 @@ import Link from "next/link"; import { Fragment } from "react"; -import { Ad } from "@/components/ads/ad"; +import { Ad, AdBanner } from "@/components/ads/ad"; +import { adPolicy, feedPositions } from "@/server/ads/manager"; import { ChartNoAxesColumn, LayoutGrid, ShieldCheck, Sparkles } from "lucide-react"; import { CategoryIcon } from "@/components/category-icon"; import { AppCard } from "@/components/app-card"; @@ -31,6 +32,9 @@ export default async function HomePage({ searchParams }: { searchParams: Promise const ranked = new Set(["popular", "trending", "top-rated"]); const chip = "inline-flex shrink-0 items-center gap-2 whitespace-nowrap rounded-full border border-border bg-surface px-4 py-2 text-sm font-semibold shadow-card transition hover:border-brand/40 hover:text-brand"; + const feed = rails.filter((r) => r !== featured); + const policy = await adPolicy(); + const adSlots = feedPositions(feed.length, policy.max.home, policy.minSectionsBetween, ["home-native", "home-display", "banner"]); return (
{welcome &&

Your email is confirmed. Welcome to Webcenta!

} @@ -76,12 +80,11 @@ export default async function HomePage({ searchParams }: { searchParams: Promise Listings appear here once they have been reviewed and published. Check back soon. ) : ( - rails.filter((r) => r !== featured).map((r, i) => ( + feed.map((r, i) => ( - {/* Ads sit between whole sections, never inside a row of apps. */} - {i === 1 && } - {i === 3 && } + {/* Ads sit between whole sections, never inside a row of apps, spaced by the placement manager. */} + {adSlots.get(i) === "banner" ? : adSlots.get(i) ? : null} )) )} diff --git a/src/app/(public)/search/page.tsx b/src/app/(public)/search/page.tsx index bde11cf..63a070e 100644 --- a/src/app/(public)/search/page.tsx +++ b/src/app/(public)/search/page.tsx @@ -1,6 +1,6 @@ import type { Metadata } from "next"; import { after } from "next/server"; -import { Ad } from "@/components/ads/ad"; +import { AdBanner } from "@/components/ads/ad"; import { FilterBar } from "@/components/filter-bar"; import { Pagination } from "@/components/pagination"; import { CardGrid } from "@/components/rail"; @@ -21,6 +21,14 @@ export async function generateMetadata({ searchParams }: Props): PromiseYou searched very quickly. Wait a minute and try again.; + } + } const ctx = await getViewerContext(); const [result, tree] = await Promise.all([searchListings(ctx, filters), getCategoryTree(ctx.maxAgeRating)]); if (filters.q && filters.page === 1) { @@ -41,7 +49,7 @@ export default async function SearchPage({ searchParams }: Props) { )} {result.truncated &&

Showing the best matches. Refine your search to see more specific results.

} -
+
); diff --git a/src/app/admin-host/(portal)/admins/page.tsx b/src/app/admin-host/(portal)/admins/page.tsx index fda121b..c7fb9c2 100644 --- a/src/app/admin-host/(portal)/admins/page.tsx +++ b/src/app/admin-host/(portal)/admins/page.tsx @@ -1,3 +1,4 @@ +import { StepUpCard } from "@/components/portal/step-up-card"; import { ActionForm } from "@/components/ui/action-form"; import { Card, Field, inputClass } from "@/components/ui/form"; import { DataTable, StatusPill, td } from "@/components/portal/table"; @@ -21,6 +22,7 @@ export default async function AdminsPage() { return ( <>

Administrators

+

Invite an administrator

diff --git a/src/app/admin-host/(portal)/imports/page.tsx b/src/app/admin-host/(portal)/imports/page.tsx index 46dc94a..64d5547 100644 --- a/src/app/admin-host/(portal)/imports/page.tsx +++ b/src/app/admin-host/(portal)/imports/page.tsx @@ -7,7 +7,7 @@ import { formatDate } from "@/lib/labels"; import { db } from "@/server/db"; import { requireAdmin } from "@/server/admin/auth"; import { bulkImportsAction, queueImportsAction } from "@/server/actions/admin"; -import { eligibleCount } from "@/server/importer/bulk"; +import { eligibleListingIds } from "@/server/importer/bulk"; import { BulkForm } from "@/components/portal/bulk-form"; import { getSection } from "@/server/settings/store"; import { getAllCategoriesTree } from "@/server/catalog/admin-categories"; @@ -18,13 +18,15 @@ export default async function ImportsAdmin({ searchParams }: { searchParams: Pro await requireAdmin("imports.manage"); const status = (await searchParams).status; const filter = ["QUEUED", "IMPORTING", "IMPORTED", "FAILED", "SKIPPED"].includes(status ?? "") ? status : undefined; - const [counts, rows, tree, s, eligible] = await Promise.all([ + const [counts, rows, tree, s, eligibleSet, cleanups] = await Promise.all([ db.importCandidate.groupBy({ by: ["status"], _count: { _all: true } }), db.importCandidate.findMany({ where: filter ? { status: filter as never } : {}, orderBy: [{ processedAt: "desc" }, { priority: "desc" }, { createdAt: "asc" }], take: 200 }), getAllCategoriesTree(), getSection("imports"), - eligibleCount(), + eligibleListingIds(), + db.auditLog.findMany({ where: { action: "imports.cleanup" }, orderBy: { createdAt: "desc" }, take: 10, select: { id: true, createdAt: true, metadata: true } }), ]); + const eligible = eligibleSet.size; const n = (k: string) => counts.find((c) => c.status === k)?._count._all ?? 0; // Review state of imported listings (status, latest scan) for the table. const listings = await db.listing.findMany({ @@ -78,7 +80,7 @@ export default async function ImportsAdmin({ searchParams }: { searchParams: Pro const pendingRev = l?.revisions[0] && ["SUBMITTED", "AUTOMATED_CHECKS", "UNDER_REVIEW"].includes(l.revisions[0].status) ? l.revisions[0] : undefined; return ( - + {r.name ?? r.domain}
{r.url}{r.reviewRequired && <>
Review required} {r.categorySlug} {r.source} @@ -107,6 +109,24 @@ export default async function ImportsAdmin({ searchParams }: { searchParams: Pro })} + +

Clean-up history

+

The daily clean-up deletes duplicate and permanently failed queue entries after {s.num("cleanupRetentionDays") || 30} days. It never deletes listings, developer submissions, reviews or saved apps.

+ {cleanups.length === 0 ?

Nothing has been cleaned up yet.

: ( +
    + {cleanups.map((c) => { + const m = (c.metadata ?? {}) as { deletedDuplicates?: number; deletedFailed?: number; deletedDeadJobs?: number; resetImporting?: number; duplicates?: Array<{ domain: string }>; failed?: Array<{ domain: string; category?: string }> }; + return ( +
  • +
    {formatDate(c.createdAt)}: {m.deletedDuplicates ?? 0} duplicate(s), {m.deletedFailed ?? 0} failed import(s), {m.deletedDeadJobs ?? 0} failed job(s) deleted; {m.resetImporting ?? 0} stuck import(s) re-queued +

    Duplicates: {(m.duplicates ?? []).map((d) => d.domain).join(", ") || "—"}. Failed: {(m.failed ?? []).map((d) => `${d.domain} (${d.category ?? "error"})`).join(", ") || "—"}.

    +
    +
  • + ); + })} +
+ )} +
); } diff --git a/src/app/admin-host/(portal)/push/page.tsx b/src/app/admin-host/(portal)/push/page.tsx index d2a8e7c..a31c442 100644 --- a/src/app/admin-host/(portal)/push/page.tsx +++ b/src/app/admin-host/(portal)/push/page.tsx @@ -6,18 +6,22 @@ import { DataTable, StatusPill, td } from "@/components/portal/table"; import { formatDate } from "@/lib/labels"; import { db } from "@/server/db"; import { requireAdmin } from "@/server/admin/auth"; -import { sendPushAction } from "@/server/actions/admin"; +import { sendPushAction, testPushAction } from "@/server/actions/admin"; import { getSection } from "@/server/settings/store"; import { pushDiagnostics } from "@/server/push/diagnostics"; export const metadata = { title: "Push notifications" }; const weekAgo = () => new Date(Date.now() - 7 * 86_400_000); -const KIND_LABEL: Record = { CAMPAIGN: "Announcement", EVENT: "Notification", REMINDER: "Reminder" }; +const KIND_LABEL: Record = { CAMPAIGN: "Announcement (promotional)", EVENT: "User notification", REMINDER: "Reminder", TEST: "Test (admin)" }; -export default async function PushAdmin({ searchParams }: { searchParams: Promise<{ kind?: string }> }) { +export default async function PushAdmin({ searchParams }: { searchParams: Promise<{ kind?: string; recipient?: string }> }) { await requireAdmin("push.send"); - const kind = (await searchParams).kind; + const sp = await searchParams; + const kind = sp.kind; + // Test push: the devices of one chosen user (by email). Endpoints and keys are never shown. + const recipientEmail = (sp.recipient ?? "").trim().toLowerCase().slice(0, 254); + const recipient = recipientEmail ? await db.user.findUnique({ where: { email: recipientEmail }, select: { id: true, name: true, email: true, pushNotifications: true, pushSubscriptions: { orderBy: { updatedAt: "desc" }, select: { id: true, platform: true, standalone: true, lastSyncedAt: true, lastSuccessAt: true, failureCount: true } } } }) : null; const since = weekAgo(); const [subscribers, signedIn, log, week, cfg, d] = await Promise.all([ db.pushSubscription.count({ where: { failureCount: { lt: 5 } } }), @@ -41,7 +45,7 @@ export default async function PushAdmin({ searchParams }: { searchParams: Promis
    {(["CAMPAIGN", "EVENT", "REMINDER"] as const).map((k) => { const w = week.find((x) => x.kind === k); - return
  • {KIND_LABEL[k]}s, last 7 days
    {w?._count._all ?? 0} sent · {w?._sum.delivered ?? 0} accepted · {w?._sum.failed ?? 0} failed
  • ; + return
  • {KIND_LABEL[k]}, last 7 days
    {w?._count._all ?? 0} sent · {w?._sum.delivered ?? 0} accepted · {w?._sum.failed ?? 0} failed
  • ; })}
@@ -58,8 +62,9 @@ export default async function PushAdmin({ searchParams }: { searchParams: Promis {stat("Devices not eligible", d.notEligible, `${d.unhealthy} failing repeatedly · ${d.optedOut} opted out`)} {stat("Last accepted delivery", d.lastAcceptedAt ? formatDate(d.lastAcceptedAt) : "never", d.lastAttemptAt ? `Last attempt ${formatDate(d.lastAttemptAt)}` : undefined)} -
+

Error categories

{d.categories.length ?
    {d.categories.map((c) =>
  • {c.category}: {c.count}
  • )}
:

No failures.

}
+

By type

{d.kinds.length ?
    {d.kinds.map((k) =>
  • {KIND_LABEL[k.kind] ?? k.kind}: {k.accepted} accepted · {k.failed} failed
  • )}
:

No attempts yet.

}

By device type

{d.platforms.length ?
    {d.platforms.map((p) =>
  • {p.platform}: {p.accepted} accepted · {p.failed} failed · {p.expired} expired
  • )}
:

No attempts yet.

}

Subscribed devices

    {d.subscriptionsByPlatform.map((p) =>
  • {p.platform}: {p.count}
  • )}
  • iPhone/iPad Home Screen apps: {d.iosStandalone}
@@ -71,6 +76,32 @@ export default async function PushAdmin({ searchParams }: { searchParams: Promis )} + +

Test push notification

+

Sends one test notification to one device of the user you choose. It is never sent to anyone else, it does not appear in anyone's notification centre, and it is logged as a test.

+
+ + +
+ {recipientEmail && !recipient &&

No account with that email.

} + {recipient && (recipient.pushSubscriptions.length === 0 + ?

{recipient.name} has no device with notifications turned on. Ask them to open Account → Notifications on the device and turn notifications on (on iPhone/iPad, from the Home Screen app).

+ : ( + + + + + {!recipient.pushNotifications &&

This user turned push copies off; a test is still allowed so you can diagnose the device.

} +
+ + +
+