Skip to main content

Migration Guide: v1.3.0

This guide helps you upgrade from v1.2.x to v1.3.0. Version 1.3.0 has no breaking changes to application logic, but includes dependency upgrades that may affect test code.

Release Date

2026-05-21

Breaking Changes Summary

ChangeImpactAction Required
nodemailer v7 → v8Error code NoAuth renamed to ENOAUTHUpdate error handling if NoAuth is used
AppSyncService.sendMessage return typeChanged from Promise<any> to void | Promise<void>Update test mocks from null to undefined

Pre-Migration Checklist

Before upgrading, verify the following:

  • Check for 'NoAuth' error code usage in your codebase
  • Check for mockResolvedValue(null) in AppSyncService.sendMessage mocks
  • Run the full test suite after upgrading

Breaking Change 1: nodemailer v8 Error Code

What Changed

nodemailer was upgraded from v7 to v8. The error code for authentication failure was renamed:

// Before (v1.2.x, nodemailer v7)
if (error.code === 'NoAuth') {
// handle authentication error
}

// After (v1.3.0, nodemailer v8)
if (error.code === 'ENOAUTH') {
// handle authentication error
}

Migration Steps

Step 1: Find usages

grep -r "'NoAuth'" --include="*.ts" src/
grep -r '"NoAuth"' --include="*.ts" src/

Step 2: Replace if found

find src/ -name "*.ts" -exec sed -i '' "s/'NoAuth'/'ENOAUTH'/g" {} \;

If no results are found, no action is required.

Breaking Change 2: AppSyncService.sendMessage Return Type

What Changed

AppSyncService.sendMessage return type changed from Promise<any> to void | Promise<void>. This only affects test code using mockResolvedValue(null).

Impact on Tests

TypeScript will report a compilation error in test files:

error TS2345: Argument of type 'null' is not assignable to parameter of type 'void | Promise<void>'.

Migration Steps

Step 1: Find affected test mocks

grep -r "sendMessage.*mockResolvedValue(null)" --include="*.spec.ts" src/
grep -r "sendMessage.*mockResolvedValue(null)" --include="*.spec.ts" test/

Step 2: Replace null with undefined

find src/ test/ -name "*.spec.ts" \
-exec sed -i '' 's/sendMessage\.mockResolvedValue(null)/sendMessage.mockResolvedValue(undefined)/g' {} \;
find src/ test/ -name "*.spec.ts" \
-exec sed -i '' 's/sendMessage: jest\.fn()\.mockResolvedValue(null)/sendMessage: jest.fn().mockResolvedValue(undefined)/g' {} \;

Before:

// Before (v1.2.x)
const mockAppSyncService = {
sendMessage: jest.fn().mockResolvedValue(null),
};

// Or inline override
appSyncService.sendMessage.mockResolvedValue(null);

After:

// After (v1.3.0)
const mockAppSyncService = {
sendMessage: jest.fn().mockResolvedValue(undefined),
};

// Or inline override
appSyncService.sendMessage.mockResolvedValue(undefined);

Upgrade Steps

Step 1: Update Dependencies

npm install \
@mbc-cqrs-serverless/core@^1.3.0 \
@mbc-cqrs-serverless/tenant@^1.3.0 \
@mbc-cqrs-serverless/master@^1.3.0 \
@mbc-cqrs-serverless/sequence@^1.3.0 \
@mbc-cqrs-serverless/task@^1.3.0 \
@mbc-cqrs-serverless/cli@^1.3.0

Step 2: Apply Code Fixes

  1. Fix NoAuthENOAUTH if used (see above)
  2. Fix mockResolvedValue(null)mockResolvedValue(undefined) in AppSyncService mocks

Step 3: Run Tests

npm run test:cov

New Features in v1.3.0

  • nodemailer v8 (improved TLS security, OAuth2 support, SMTP command injection protection)
  • No new framework APIs

Support

If you encounter issues during migration: