fix: mothership notifications

This commit is contained in:
Ben Allfree 2024-11-26 11:41:01 +00:00
parent d663500a19
commit 3400d9ce94
7 changed files with 38 additions and 16 deletions

View File

@ -1,5 +0,0 @@
---
'pockethost': minor
---
Enh: Added custom instance idle TTL support

View File

@ -1,5 +0,0 @@
---
'pockethost': minor
---
Added support for instances hosted on alternate volumes

View File

@ -1,5 +0,0 @@
---
'pockethost': minor
---
Feature: cloud volume support for instances

View File

@ -1,5 +1,17 @@
# pockethost
## 2.1.0
### Minor Changes
- 2d2ce8c: Enh: Added custom instance idle TTL support
- 26d1070: Added support for instances hosted on alternate volumes
- eb9d8a4: Feature: cloud volume support for instances
### Patch Changes
- Fix: Mothership notifications where not being sent out
## 2.0.2
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "pockethost",
"version": "2.0.2",
"version": "2.1.0",
"author": {
"name": "Ben Allfree",
"url": "https://github.com/benallfree"

View File

@ -33,6 +33,7 @@ __export(lib_exports, {
HandleMirrorData: () => HandleMirrorData,
HandleNotifyDiscordAfterCreate: () => HandleNotifyDiscordAfterCreate,
HandleNotifyMaintenanceMode: () => HandleNotifyMaintenanceMode,
HandleProcessNotification: () => HandleProcessNotification,
HandleProcessSingleNotification: () => HandleProcessSingleNotification,
HandleSesError: () => HandleSesError,
HandleSignupCheck: () => HandleSignupCheck,
@ -786,6 +787,28 @@ var HandleProcessSingleNotification = (c) => {
return c.json(200, { status: "ok" });
};
// src/lib/handlers/notify/model/HandleProcessNotification.ts
var HandleProcessNotification = (e) => {
const dao = e.dao || $app.dao();
const log = mkLog(`notification:sendImmediately`);
const audit = mkAudit(log, dao);
const processNotification = mkNotificationProcessor(log, dao, false);
const notificationRec = e.model;
log({ notificationRec });
try {
dao.expandRecord(notificationRec, ["message_template"]);
const messageTemplateRec = notificationRec.expandedOne(`message_template`);
if (!messageTemplateRec) {
throw new Error(`Missing message template`);
}
processNotification(notificationRec);
} catch (e2) {
audit(`ERROR`, `${e2}`, {
notification: notificationRec.getId()
});
}
};
// src/lib/handlers/notify/model/HandleUserWelcomeMessage.ts
var HandleUserWelcomeMessage = (e) => {
const dao = e.dao || $app.dao();
@ -3122,6 +3145,7 @@ var HandleVersionsRequest = (c) => {
HandleMirrorData,
HandleNotifyDiscordAfterCreate,
HandleNotifyMaintenanceMode,
HandleProcessNotification,
HandleProcessSingleNotification,
HandleSesError,
HandleSignupCheck,

View File

@ -1,2 +1,3 @@
export * from './api/HandleProcessSingleNotification'
export * from './model/HandleProcessNotification'
export * from './model/HandleUserWelcomeMessage'