This is an automated email from the ASF dual-hosted git repository.

heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-ui.git


The following commit(s) were added to refs/heads/master by this push:
     new 82c401af fix observer to distinguish parameters on requests
82c401af is described below

commit 82c401af4ce1e8f05b892ede64906d5422404066
Author: Alex Heneveld <[email protected]>
AuthorDate: Fri Nov 4 23:22:59 2022 +0000

    fix observer to distinguish parameters on requests
---
 ui-modules/utils/providers/api-observer-interceptor.provider.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/ui-modules/utils/providers/api-observer-interceptor.provider.js 
b/ui-modules/utils/providers/api-observer-interceptor.provider.js
index df8d21f8..40a4b273 100644
--- a/ui-modules/utils/providers/api-observer-interceptor.provider.js
+++ b/ui-modules/utils/providers/api-observer-interceptor.provider.js
@@ -53,10 +53,11 @@ export function apiObserverInterceptorProvider() {
                         response.clock = Observable.interval(interval);
                     }
                     response.subscribe = (next, error, complete)=> {
-                        if (!OBSERVER_CACHE.has(response.config.url)) {
-                            OBSERVER_CACHE.set(response.config.url, 
response.clock.mapTo(coldObservableFactory(response.config)).exhaust().share());
+                        const key = 
response.config.url+'?'+JSON.stringify(response.config.params);
+                        if (!OBSERVER_CACHE.has(key)) {
+                            OBSERVER_CACHE.set(key, 
response.clock.mapTo(coldObservableFactory(response.config)).exhaust().share());
                         }
-                        return 
OBSERVER_CACHE.get(response.config.url).subscribe(next, error, complete);
+                        return OBSERVER_CACHE.get(key).subscribe(next, error, 
complete);
                     }
                 }
             }

Reply via email to