whatsapp-pi 1.0.27 → 1.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -13
- package/package.json +1 -1
- package/src/services/whatsapp.service.ts +12 -3
package/README.md
CHANGED
|
@@ -108,19 +108,6 @@ specs/ # Feature specifications
|
|
|
108
108
|
tests/ # Unit and integration tests
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
## Documentation
|
|
112
|
-
|
|
113
|
-
See `specs/` directory for detailed feature documentation:
|
|
114
|
-
- `001-whatsapp-tui-integration/` - TUI menu system
|
|
115
|
-
- `002-manual-whatsapp-connection/` - Connection management
|
|
116
|
-
- `003-whatsapp-messaging-refactor/` - Reliable messaging
|
|
117
|
-
- `004-blocked-numbers-management/` - Block list feature
|
|
118
|
-
- `005-verbose-mode-support/` - Logging and tracing
|
|
119
|
-
- `006-auto-connect-flag/` - Automatic connection support
|
|
120
|
-
- `007-image-recognition/` - Vision analysis integration
|
|
121
|
-
- `008-document-message-support/` - Document handling and storage
|
|
122
|
-
- `009-localize-system-messages/` - US English localization
|
|
123
|
-
|
|
124
111
|
## Development
|
|
125
112
|
|
|
126
113
|
Run tests:
|
package/package.json
CHANGED
|
@@ -84,6 +84,7 @@ export class WhatsAppService {
|
|
|
84
84
|
creds: state.creds,
|
|
85
85
|
keys: makeCacheableSignalKeyStore(state.keys, logger),
|
|
86
86
|
},
|
|
87
|
+
syncFullHistory: false,
|
|
87
88
|
logger,
|
|
88
89
|
});
|
|
89
90
|
|
|
@@ -107,17 +108,25 @@ export class WhatsAppService {
|
|
|
107
108
|
const shouldReconnect = statusCode !== DisconnectReason.loggedOut;
|
|
108
109
|
const shouldTreatAsLoggedOut =
|
|
109
110
|
errorMessage.includes('bad-request') ||
|
|
111
|
+
errorMessage.includes('Bad MAC') ||
|
|
110
112
|
statusCode === 400 ||
|
|
111
113
|
statusCode === 401 ||
|
|
112
114
|
statusCode === DisconnectReason.loggedOut ||
|
|
113
115
|
statusCode === DisconnectReason.badSession;
|
|
114
|
-
|
|
116
|
+
|
|
115
117
|
console.error(`Connection closed [${statusCode}]. Reconnecting: ${shouldReconnect}`);
|
|
116
|
-
|
|
118
|
+
|
|
117
119
|
if (shouldTreatAsLoggedOut) {
|
|
118
120
|
console.error(`Session invalid or logged out [${statusCode}] - preserving auth state and requiring re-auth`);
|
|
121
|
+
if (errorMessage.includes('Bad MAC')) {
|
|
122
|
+
console.error('[WhatsApp-Pi] Bad MAC error detected. Your session keys are corrupted.');
|
|
123
|
+
console.error('[WhatsApp-Pi] Run /whatsapp-logout to clear auth state, then reconnect with /whatsapp-connect');
|
|
124
|
+
this.onStatusUpdate?.('| WhatsApp: Session Error (Bad MAC)');
|
|
125
|
+
}
|
|
119
126
|
this.sessionManager.setStatus('logged-out');
|
|
120
|
-
|
|
127
|
+
if (!errorMessage.includes('Bad MAC')) {
|
|
128
|
+
this.onStatusUpdate?.('| WhatsApp: Logged out');
|
|
129
|
+
}
|
|
121
130
|
return;
|
|
122
131
|
}
|
|
123
132
|
|