http-request-manager 18.16.16 → 18.16.17
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.
|
@@ -6752,15 +6752,16 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
6752
6752
|
? message.data.content.content
|
|
6753
6753
|
: message.data?.content;
|
|
6754
6754
|
console.log('🔍 State Manager: Sender sessionId:', stateManagerSenderId, 'Own sessionId:', this.ownSessionId);
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6755
|
+
// ALWAYS process state manager messages - even from self
|
|
6756
|
+
// This ensures originator's state stays in sync with server response
|
|
6757
|
+
// which may include server-side transformations, computed fields, or validation results
|
|
6758
|
+
console.log('💬 State Manager Message (processing regardless of sender):', {
|
|
6759
|
+
isOwnMessage: stateManagerSenderId === this.ownSessionId,
|
|
6760
|
+
path: stateManagerContent?.path,
|
|
6761
|
+
method: stateManagerContent?.method
|
|
6762
|
+
});
|
|
6763
|
+
this.userAction.next(message.data);
|
|
6764
|
+
this.fetchRecord(RequestOptions.adapt({ path: stateManagerContent?.path }), stateManagerContent?.method);
|
|
6764
6765
|
break;
|
|
6765
6766
|
case 'channelMessage':
|
|
6766
6767
|
// Handle channel-based messages (from sendChannelMessage)
|
|
@@ -7147,21 +7148,11 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
7147
7148
|
// FETCH RECORD
|
|
7148
7149
|
this.fetchRecord = (options, method) => this.effect(() => of(RequestOptions.adapt(options)).pipe(tap(() => console.log('🔄 fetchRecord effect triggered with path:', options?.path, 'method:', method)), switchMap((options) => {
|
|
7149
7150
|
this.streamedResponse = [];
|
|
7150
|
-
// Temporarily update apiOptions.path with the path from the WebSocket message
|
|
7151
|
-
// This ensures the request goes to the correct endpoint
|
|
7152
|
-
const originalPath = this.apiOptions.path;
|
|
7153
|
-
if (options?.path && Array.isArray(options.path)) {
|
|
7154
|
-
this.apiOptions.path = options.path;
|
|
7155
|
-
console.log('🔧 Temporarily set apiOptions.path to:', options.path);
|
|
7156
|
-
}
|
|
7157
7151
|
const requestOptions = this.updateRequestOptions(options?.headers);
|
|
7158
|
-
console.log('🌐 Making GET request to path:',
|
|
7159
|
-
return this.httpManagerService.getRequest(requestOptions)
|
|
7152
|
+
console.log('🌐 Making GET request to path:', [...(requestOptions.path || []), ...(options?.path || [])]);
|
|
7153
|
+
return this.httpManagerService.getRequest(requestOptions, options?.path)
|
|
7160
7154
|
.pipe(tap((data) => {
|
|
7161
7155
|
console.log('📦 fetchRecord received data:', data);
|
|
7162
|
-
// Restore original path after request completes
|
|
7163
|
-
this.apiOptions.path = originalPath;
|
|
7164
|
-
console.log('🔧 Restored apiOptions.path to:', originalPath);
|
|
7165
7156
|
// Apply adapter if provided
|
|
7166
7157
|
let adaptedData = this.applyAdapter(data);
|
|
7167
7158
|
adaptedData = (!adaptedData) ? (this.dataType === DataType.ARRAY) ? [] : {} : adaptedData;
|