Compare commits

..
Author SHA1 Message Date
joshua 305499ee91 Merge branch 'fix/unhandled-rejection-no-crash' into main
Stops the server from hard-crashing on unhandled promise rejections, and bumps version to 1.9.3.
2026-08-26 09:07:06 +02:00
joshua c2112bf707 Bump version to 1.9.3 2026-08-26 09:06:52 +02:00
joshua e63fb2cc27 Stop crashing the server on unhandled promise rejections
A single missed .catch() anywhere in the notification code (email/WhatsApp
sending) previously took down the whole process via process.exit(1). Log
the error instead and keep running.
2026-08-26 09:03:15 +02:00
5 changed files with 11 additions and 7 deletions
+3
View File
@@ -7,8 +7,11 @@ and this project follows [Semantic Versioning](https://semver.org/).
## [Unreleased]
## [1.9.3] - 2026-08-26
### Fixed
- The server used to hard-crash (`process.exit(1)`) on any unhandled promise rejection, so a single missed error handler anywhere in the app's fire-and-forget notification code (email/WhatsApp sending) could take the whole server down. It now logs the error and keeps running.
- Accounts created on someone's behalf (at-the-door walk-in registration, or manual registration from the Admin/Supervisor dashboard) now get their activation link (email or WhatsApp, whichever they have) sent immediately when the account is created, instead of only on their first failed login attempt — matching what the Terms of Use already promised.
- Manual registration with a real email address used to create the account already active with a fixed, undisclosed password (`Hope123`) — the visitor had no way to know it. That account is now created inactive and gets the same immediate activation link, so the visitor sets their own password — unless a password was supplied directly (see below), in which case it's activated immediately with no link needed.
- The self-service kiosk's "Create an account" password field never actually worked — the account was always created with a different password behind the scenes, so visitors who set one couldn't log in with it. Manual registration now honours a caller-supplied password and activates the account immediately instead of discarding it.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "event-management-backend",
"version": "1.9.2",
"version": "1.9.3",
"description": "Event Management System Backend",
"main": "src/index.js",
"scripts": {
+5 -4
View File
@@ -1265,11 +1265,12 @@ app.listen(PORT, () => {
}
});
// Handle unhandled promise rejections
// Log unhandled promise rejections without killing the server, since a single
// missed .catch() on fire-and-forget notification code (email/WhatsApp sends)
// would otherwise take the whole app down.
process.on('unhandledRejection', (err) => {
console.log('UNHANDLED REJECTION! Shutting down...');
console.log(err.name, err.message);
process.exit(1);
console.error('UNHANDLED REJECTION!', err?.name, err?.message);
console.error(err?.stack || err);
});
module.exports = { app, prisma };
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hope-events-frontend",
"version": "1.9.2",
"version": "1.9.3",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hope-events",
"version": "1.9.2",
"version": "1.9.3",
"main": "index.js",
"scripts": {
"dev:backend": "cd backend && npm run dev",