v0.4.0 BREAKING CHANGES - nself-org/nchat GitHub Wiki

nChat v0.4.0 Breaking Changes

Version: 0.4.0 Release Date: January 30, 2026


Summary

Good News: nChat v0.4.0 has NO BREAKING CHANGES. This release is fully backward compatible with v0.3.0.

All new features are:

  • Additive only (no removals)
  • Opt-in (disabled by default)
  • Backward compatible (existing functionality unchanged)
  • Zero downtime (can upgrade without stopping services)

What's NOT Breaking

1. Database Schema ✅

All changes are additive:

  • ✅ 8 new tables added (no tables removed)
  • ✅ 2 tables modified with new columns (existing columns unchanged)
  • ✅ All existing data preserved
  • ✅ No data migrations required
  • ✅ Existing queries continue to work

Before v0.4.0:

SELECT id, content, user_id, channel_id
FROM nchat_messages
WHERE channel_id = 'abc123';

After v0.4.0:

-- Same query still works
SELECT id, content, user_id, channel_id
FROM nchat_messages
WHERE channel_id = 'abc123';

-- New columns are optional
SELECT id, content, user_id, channel_id, is_encrypted, encrypted_payload
FROM nchat_messages
WHERE channel_id = 'abc123';

2. API Endpoints ✅

No existing endpoints removed or modified:

  • ✅ All v0.3.0 endpoints continue to work
  • ✅ GraphQL queries unchanged
  • ✅ REST API endpoints unchanged
  • ✅ WebSocket events unchanged

New endpoints added (opt-in):

  • /api/e2ee/initialize - E2EE setup
  • /api/e2ee/recover - E2EE recovery
  • /api/e2ee/safety-number - Safety number generation
  • /api/e2ee/keys/replenish - Prekey replenishment

3. Environment Variables ✅

All existing variables continue to work:

  • ✅ No variables removed
  • ✅ No variables renamed
  • ✅ No default behavior changed

New variables are optional:

# These are NEW and OPTIONAL (not required)
NEXT_PUBLIC_FEATURE_E2EE=false  # Default: false (disabled)
NEXT_PUBLIC_FEATURE_VIDEO_CALLS_HD=false  # Default: false
NEXT_PUBLIC_MEDIA_SERVER_URL=http://localhost:3100  # Only needed if using video calls

Existing variables unchanged:

# These all continue to work exactly as before
NEXT_PUBLIC_GRAPHQL_URL=http://api.localhost/v1/graphql
NEXT_PUBLIC_AUTH_URL=http://auth.localhost/v1/auth
NEXT_PUBLIC_USE_DEV_AUTH=true

4. Configuration Schema ✅

AppConfig is backward compatible:

  • ✅ All existing config fields work as before
  • ✅ New fields are optional with sensible defaults
  • ✅ No validation changes to existing fields

Before v0.4.0:

interface AppConfig {
  features: {
    publicChannels: boolean
    privateChannels: boolean
    directMessages: boolean
    // ... other v0.3.0 features
  }
}

After v0.4.0:

interface AppConfig {
  features: {
    // All v0.3.0 features still here
    publicChannels: boolean
    privateChannels: boolean
    directMessages: boolean

    // New optional features (default: false)
    endToEndEncryption?: boolean
    videoCallsHD?: boolean
  }

  // New optional encryption config
  encryption?: {
    enabled: boolean
    // ... other E2EE settings
  }
}

5. React Components ✅

All existing components work unchanged:

  • <MessageList /> - works as before
  • <MessageInput /> - works as before
  • <ChannelList /> - works as before
  • ✅ No prop changes to existing components
  • ✅ No component removals

New components are separate:

  • <E2EESetup /> - New, opt-in component
  • <E2EEStatus /> - New, opt-in component
  • <VideoCallModal /> - New, opt-in component

6. TypeScript Types ✅

No type changes to existing interfaces:

  • ✅ All v0.3.0 types unchanged
  • ✅ New types are separate/optional
  • ✅ No interface property removals

Example - Message type:

// Before v0.4.0
interface Message {
  id: string
  content: string
  userId: string
  channelId: string
  createdAt: string
}

// After v0.4.0 - SAME, with optional new fields
interface Message {
  id: string
  content: string
  userId: string
  channelId: string
  createdAt: string

  // New optional fields
  isEncrypted?: boolean
  encryptedPayload?: Uint8Array
  senderDeviceId?: string
}

Deprecation Notices

Nothing deprecated in v0.4.0.

No features, APIs, or configurations are marked for deprecation.


Behavioral Changes

None - All Behavior Identical by Default

When you upgrade to v0.4.0 without enabling new features, the application behaves identically to v0.3.0:

Feature Default State Behavior
E2EE Disabled Messages sent/received as plaintext (same as v0.3.0)
Video Calling Disabled Audio-only calls (same as v0.3.0)
Screen Sharing Disabled Not available (same as v0.3.0)
Background Effects Disabled Not available (same as v0.3.0)

To get new features, you must explicitly enable them.


Migration Path

Zero-Downtime Upgrade

Because there are no breaking changes, you can upgrade with zero downtime:

# 1. Pull new code (application keeps running)
git pull origin main

# 2. Install dependencies (application keeps running)
pnpm install

# 3. Run database migrations (additive only, no locks)
cd .backend && nself db migrate up

# 4. Restart application (quick restart, no configuration changes needed)
pm2 restart nchat-frontend

No configuration changes required. Application works immediately.


Developer Impact

TypeScript Compilation ✅

No type errors introduced:

pnpm type-check
# ✅ 0 errors (same as v0.3.0)

Tests ✅

All existing tests pass:

pnpm test
# ✅ All v0.3.0 tests pass unchanged

Linting ✅

No linting errors:

pnpm lint
# ✅ 0 errors (same as v0.3.0)

What You Need to Do

Minimal Upgrade (No New Features)

If you just want security patches and improvements:

# 1. Backup database
cd .backend && docker exec -t nself-postgres pg_dump -U postgres nchat > backup.sql

# 2. Update code
git pull origin main

# 3. Install dependencies
pnpm install

# 4. Run migrations
cd .backend && nself db migrate up

# 5. Restart
pnpm build && pm2 restart nchat-frontend

That's it. No configuration changes needed.

Enable New Features (Optional)

If you want E2EE and video calling:

# After upgrade, add to .env.local:
NEXT_PUBLIC_FEATURE_E2EE=true
NEXT_PUBLIC_FEATURE_VIDEO_CALLS_HD=true
NEXT_PUBLIC_MEDIA_SERVER_URL=http://localhost:3100

# Setup media server (for video calls)
cd .backend
./scripts/setup-media-server.sh

# Restart with new config
pnpm dev

Known Compatibility Issues

None - Fully Compatible

There are no known compatibility issues with:

  • ✅ v0.3.0 databases
  • ✅ v0.3.0 configurations
  • ✅ v0.3.0 client applications
  • ✅ v0.3.0 API consumers
  • ✅ v0.3.0 deployments (Docker, K8s, etc.)

Version Support

v0.3.0 Support

  • Supported - v0.3.0 will receive critical security patches
  • Upgrade Recommended - v0.4.0 includes security improvements
  • End of Life - June 30, 2026 (6 months)

Upgrade Timeline

Recommended: Upgrade within 30 days Required: Upgrade before June 30, 2026


Questions and Answers

Q: Will my existing data be affected?

A: No. All existing data (messages, users, channels) remains unchanged and fully compatible.


Q: Do I need to update my client applications?

A: No. Client applications built for v0.3.0 will continue to work with v0.4.0 servers.


Q: Do I need to change my environment variables?

A: No. All v0.3.0 environment variables work unchanged. New variables are optional.


Q: Do I need to update my deployment scripts?

A: No. Deployment scripts for v0.3.0 work unchanged for v0.4.0.


Q: Can I rollback if something goes wrong?

A: Yes. Rollback is fully supported. See Upgrade Guide.


Q: Will this break my integrations (bots, webhooks)?

A: No. All v0.3.0 integrations continue to work unchanged.


Q: Do I need to retrain my users?

A: No (unless you enable new features). The UI is identical for disabled features.


Q: What if I don't want E2EE or video calling?

A: Just don't enable them. The features are opt-in and disabled by default.


Comparison with Previous Releases

v0.3.0 → v0.4.0 (This Release)

  • Zero breaking changes
  • ✅ Fully backward compatible
  • ✅ Additive only

v0.2.0 → v0.3.0 (Previous Release)

  • ⚠️ 1 breaking change: Environment variable rename (NEXT_PUBLIC_API_URLNEXT_PUBLIC_GRAPHQL_URL)
  • ⚠️ Database migration required (additive)

v0.1.0 → v0.2.0

  • ⚠️ 2 breaking changes: Node.js 20+ required, pnpm 9+ required
  • ⚠️ Configuration format changed

Conclusion: v0.4.0 is the smoothest upgrade yet.


Conclusion

nChat v0.4.0 has NO breaking changes.

This is a drop-in replacement for v0.3.0 with:

  • ✅ Full backward compatibility
  • ✅ Zero configuration changes required
  • ✅ All existing functionality preserved
  • ✅ New features are opt-in only
  • ✅ Zero downtime upgrade supported

Recommendation: Upgrade with confidence. No breaking changes to worry about.


Additional Resources


Contact

Questions about breaking changes or upgrade compatibility?


Summary: Upgrade to v0.4.0 worry-free. There are no breaking changes. 🎉

⚠️ **GitHub.com Fallback** ⚠️