@hkdigital/lib-core 0.4.72 → 0.4.74
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.
|
@@ -410,8 +410,8 @@ export default class IndexedDbCache {
|
|
|
410
410
|
responseBody.size :
|
|
411
411
|
responseBody.length || 0;
|
|
412
412
|
|
|
413
|
-
console.debug(`cache-retrieval: fixing content-length from ${responseHeaders.get('content-length')} to ${bodySize}`);
|
|
414
|
-
console.debug(`cache-retrieval: body type=${typeof responseBody}, constructor=${responseBody?.constructor?.name},
|
|
413
|
+
// console.debug(`cache-retrieval: fixing content-length from ${responseHeaders.get('content-length')} to ${bodySize}`);
|
|
414
|
+
// console.debug(`cache-retrieval: body type=${typeof responseBody}, constructor=${responseBody?.constructor?.name}, bodySize=${bodySize}`);
|
|
415
415
|
|
|
416
416
|
// Add/fix Content-Length header with actual size
|
|
417
417
|
responseHeaders.set('content-length', bodySize.toString());
|
|
@@ -387,8 +387,8 @@ export async function httpRequest(options) {
|
|
|
387
387
|
if (!isTestEnv) {
|
|
388
388
|
if (cachedResponse) {
|
|
389
389
|
console.debug(`http:cache-hit [${url.pathname}]`);
|
|
390
|
-
console.debug(`cached-response has body: ${!!cachedResponse.body}`);
|
|
391
|
-
console.debug(`cached-response content-length: ${cachedResponse.headers.get('content-length')}`);
|
|
390
|
+
// console.debug(`cached-response has body: ${!!cachedResponse.body}`);
|
|
391
|
+
// console.debug(`cached-response content-length: ${cachedResponse.headers.get('content-length')}`);
|
|
392
392
|
return cachedResponse;
|
|
393
393
|
} else {
|
|
394
394
|
console.debug(`http:cache-miss [${url.pathname}]`);
|
|
@@ -245,7 +245,7 @@ export function loadResponseBuffer(response, onProgress) {
|
|
|
245
245
|
let bytesLoaded = 0;
|
|
246
246
|
|
|
247
247
|
if (onProgress /*&& size*/) {
|
|
248
|
-
console.debug(`loadResponseBuffer:initial-progress size=${size}`);
|
|
248
|
+
// console.debug(`loadResponseBuffer:initial-progress size=${size}`);
|
|
249
249
|
onProgress({ bytesLoaded, size });
|
|
250
250
|
}
|
|
251
251
|
|
|
@@ -275,7 +275,7 @@ export function loadResponseBuffer(response, onProgress) {
|
|
|
275
275
|
chunks.push(value);
|
|
276
276
|
|
|
277
277
|
if (onProgress /*&& size*/) {
|
|
278
|
-
console.debug(`loadResponseBuffer:chunk-progress ${bytesLoaded}/${size}`);
|
|
278
|
+
// console.debug(`loadResponseBuffer:chunk-progress ${bytesLoaded}/${size}`);
|
|
279
279
|
onProgress({ bytesLoaded, size });
|
|
280
280
|
}
|
|
281
281
|
}
|
|
@@ -99,6 +99,8 @@ export default class SceneBase {
|
|
|
99
99
|
*/
|
|
100
100
|
constructor() {
|
|
101
101
|
this.#state.onenter = (currentState) => {
|
|
102
|
+
console.debug('SceneBase:onenter', currentState);
|
|
103
|
+
|
|
102
104
|
if (currentState === STATE_LOADING) {
|
|
103
105
|
this.#startLoading();
|
|
104
106
|
} else if (currentState === STATE_ABORTING) {
|
|
@@ -112,7 +114,9 @@ export default class SceneBase {
|
|
|
112
114
|
if (this.state === STATE_LOADING) {
|
|
113
115
|
const { sourcesLoaded, numberOfSources } = this.progress;
|
|
114
116
|
|
|
115
|
-
|
|
117
|
+
console.debug( 'SceneBase:check-for-loaded', {sourcesLoaded, numberOfSources} );
|
|
118
|
+
|
|
119
|
+
if (sourcesLoaded === numberOfSources) {
|
|
116
120
|
this.#state.send(LOADED);
|
|
117
121
|
}
|
|
118
122
|
}
|
|
@@ -283,6 +287,8 @@ export default class SceneBase {
|
|
|
283
287
|
// 0 means no timeout, but actually we use max timeout
|
|
284
288
|
const waitTimeout = timeoutMs > 0 ? timeoutMs : MAX_TIMEOUT_MS;
|
|
285
289
|
|
|
290
|
+
console.debug('SceneBase:waitForState:currentState', this.state);
|
|
291
|
+
|
|
286
292
|
waitForState(() => {
|
|
287
293
|
return (
|
|
288
294
|
this.loaded ||
|