http-request-manager 18.16.8 → 18.16.12
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.
|
@@ -2533,7 +2533,13 @@ class WebSocketMessageService {
|
|
|
2533
2533
|
return false;
|
|
2534
2534
|
}
|
|
2535
2535
|
const channel = `${ChannelType$1.STATE}-${path.join('/')}`;
|
|
2536
|
-
|
|
2536
|
+
// Send flat payload to avoid double-nesting:
|
|
2537
|
+
// sendMessageInChannel wraps content in { type, subscribedChannel, content },
|
|
2538
|
+
// so we pass { method, path, user } directly instead of the full StateMessage
|
|
2539
|
+
this.wsManagerService.sendMessageInChannel(channel, {
|
|
2540
|
+
...payload.content,
|
|
2541
|
+
user: payload.sessionId
|
|
2542
|
+
});
|
|
2537
2543
|
return true;
|
|
2538
2544
|
}
|
|
2539
2545
|
/**
|
|
@@ -6731,23 +6737,26 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
6731
6737
|
break;
|
|
6732
6738
|
case 'statemanagerMessage':
|
|
6733
6739
|
case 'stateMangerMessage':
|
|
6734
|
-
// CRITICAL DEBUG: Log channel comparison
|
|
6735
6740
|
console.log('🔍 [STATE STORE] stateMangerMessage received:', {
|
|
6736
6741
|
messageChannel: message.channel,
|
|
6737
6742
|
ourChannel: this.apiOptions.ws?.id,
|
|
6738
6743
|
channelsMatch: message.channel === this.apiOptions.ws?.id,
|
|
6739
|
-
senderSessionId: message.data
|
|
6744
|
+
senderSessionId: message.data?.sessionId?.id || message.data?.sessionId,
|
|
6740
6745
|
ourSessionId: this.ownSessionId
|
|
6741
6746
|
});
|
|
6742
|
-
//
|
|
6743
|
-
//
|
|
6744
|
-
|
|
6747
|
+
// Handle both direct payload and StateMessage-wrapped payload:
|
|
6748
|
+
// Direct: { method, path, user }
|
|
6749
|
+
// Wrapped: { sessionId, content: { method, path } }
|
|
6750
|
+
const stateManagerSenderId = message.data?.sessionId?.id || message.data?.sessionId;
|
|
6751
|
+
const stateManagerContent = message.data?.content?.content
|
|
6752
|
+
? message.data.content.content
|
|
6753
|
+
: message.data?.content;
|
|
6745
6754
|
console.log('🔍 State Manager: Sender sessionId:', stateManagerSenderId, 'Own sessionId:', this.ownSessionId);
|
|
6746
6755
|
if (stateManagerSenderId !== this.ownSessionId) {
|
|
6747
6756
|
console.log('💬 State Manager Message:', message.data);
|
|
6748
|
-
console.log('📥 Fetching record with path:',
|
|
6757
|
+
console.log('📥 Fetching record with path:', stateManagerContent?.path, 'method:', stateManagerContent?.method);
|
|
6749
6758
|
this.userAction.next(message.data);
|
|
6750
|
-
this.fetchRecord(RequestOptions.adapt({ path:
|
|
6759
|
+
this.fetchRecord(RequestOptions.adapt({ path: stateManagerContent?.path }), stateManagerContent?.method);
|
|
6751
6760
|
}
|
|
6752
6761
|
else {
|
|
6753
6762
|
console.log('⏭️ Skipping own message (sessionId match)');
|