• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

geosolutions-it / MapStore2 / 30537984605

30 Jul 2026 11:17AM UTC coverage: 75.829% (+0.05%) from 75.781%
30537984605

Pull #12753

github

web-flow
Merge 023d727fe into 6e2ab5682
Pull Request #12753: Identify: EXTERNAL DATA view type #12596

36262 of 57075 branches covered (63.53%)

444 of 546 new or added lines in 13 files covered. (81.32%)

3 existing lines in 2 files now uncovered.

45167 of 59564 relevant lines covered (75.83%)

123.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.0
/web/client/utils/ExternalDataCache.js
1
/*
2
 * Copyright 2026, GeoSolutions Sas.
3
 * All rights reserved.
4
 *
5
 * This source code is licensed under the BSD-style license found in the
6
 * LICENSE file in the root directory of this source tree.
7
 */
8

9
const MAX_CACHE_ENTRIES = 500;
3✔
10
// Store promises so concurrent renders can share the same in-flight request.
11
const requestCache = new Map();
3✔
12

13
/**
14
 * Builds a key that isolates requests by identify run, feature and query.
15
 */
16
export const createExternalDataCacheKey = ({
3✔
17
    identifyRequestId,
18
    sourceFeatureId,
19
    sourceFeatureIndex,
20
    url,
21
    layerName,
22
    cqlFilter
23
}) => JSON.stringify([
66✔
24
    identifyRequestId,
25
    sourceFeatureId,
26
    sourceFeatureIndex,
27
    url,
28
    layerName,
29
    cqlFilter
30
]);
31

32
export const getExternalDataCacheEntry = (key) =>
3✔
33
    requestCache.get(key)?.request;
45✔
34

35
/**
36
 * Caches an external WFS request and associates it with its identify run.
37
 */
38
export const setExternalDataCacheEntry = (key, request, identifyRequestId) => {
3✔
39
    if (requestCache.size >= MAX_CACHE_ENTRIES) {
36!
NEW
40
        requestCache.delete(requestCache.keys().next().value);
×
41
    }
42
    requestCache.set(key, { identifyRequestId, request });
36✔
43
    return request;
36✔
44
};
45

46
export const deleteExternalDataCacheEntry = (key) => {
3✔
47
    requestCache.delete(key);
15✔
48
};
49

50
/**
51
 * Removes cached requests when their identify results are discarded.
52
 */
53
export const clearExternalDataCacheForIdentifyRequests = (identifyRequestIds = []) => {
3!
54
    const requestIds = new Set(identifyRequestIds.filter(Boolean));
84✔
55
    if (!requestIds.size) {
84✔
56
        return;
42✔
57
    }
58
    requestCache.forEach((entry, key) => {
42✔
59
        if (requestIds.has(entry.identifyRequestId)) {
27✔
60
            requestCache.delete(key);
24✔
61
        }
62
    });
63
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc