Log even more garbage
Test / test (push) Failing after 54s
Details
Test / test (push) Failing after 54s
Details
This commit is contained in:
parent
121cc90de9
commit
b816cb56da
|
|
@ -136,19 +136,31 @@ export default function start(self: ServiceWorkerGlobalScope) {
|
|||
subscription: PushSubscription,
|
||||
db: ReturnType<typeof database>
|
||||
) {
|
||||
const response = await fetch(`${process.env.BASE_URL}/api/subscription/`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(subscription),
|
||||
})
|
||||
try {
|
||||
await sendMessage({
|
||||
message: `URL ${process.env.BASE_URL}/api/subscription/`,
|
||||
})
|
||||
|
||||
await sendMessage({
|
||||
message: `Response status ${response.status}`,
|
||||
})
|
||||
const response = await fetch(
|
||||
`${process.env.BASE_URL}/api/subscription/`,
|
||||
{
|
||||
method: "POST",
|
||||
body: JSON.stringify(subscription),
|
||||
}
|
||||
)
|
||||
|
||||
db.subscriptions.put({
|
||||
id: 1,
|
||||
subscriptionId: (await response.json()).subscriptionId,
|
||||
})
|
||||
await sendMessage({
|
||||
message: `Response status ${response.status}`,
|
||||
})
|
||||
db.subscriptions.put({
|
||||
id: 1,
|
||||
subscriptionId: (await response.json()).subscriptionId,
|
||||
})
|
||||
} catch (error) {
|
||||
await sendMessage({
|
||||
message: `ERRRROR ${(error as Error).toString()}}`,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function putSubscription(subscription: PushSubscription, id: number) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue