diff --git a/core/fetch/src/fetch.ts b/core/fetch/src/fetch.ts index a80af321d..a516bece0 100644 --- a/core/fetch/src/fetch.ts +++ b/core/fetch/src/fetch.ts @@ -36,6 +36,7 @@ export async function fetchContext( fetchOption: FetchOptions, dispatchOptions?: Partial, ): Promise { + logger.logMethodArgs('fetchContext', {contextName}); if (cacheSupported && contextProvider.getValue(contextName) == null) { try { fetchOption.cacheStrategy = 'cache_only'; @@ -58,8 +59,9 @@ export async function fetchContext( const response = await serviceRequest(fetchOption); if ( response.meta?.lastUpdated === undefined || // skip lastUpdated check - response.meta?.lastUpdated !== contextProvider.getValue(contextName)?.meta?.reversion + response.meta?.lastUpdated !== contextProvider.getValue(contextName)?.meta?.lastUpdated ) { + logger.logOther('fetchContext:', 'contextProvider.setValue(new-received-context)', {contextName}); contextProvider.setValue(contextName, response, dispatchOptions); } } @@ -78,7 +80,7 @@ export async function serviceRequest< >( options: FetchOptions, ): Promise | AlwatrServiceResponseSuccessWithMeta> { - logger.logMethod('serviceRequest'); + logger.logMethodArgs('serviceRequest', {url: options.url}); if (isBrowser) { options.headers ??= {};