Skip to content

Rules manager - clear cache on standalone geofence and multiple gs instances does not work fully #12271

Closed
1 of 1 issue completed

Description

@MV88

Description

Currently MS is invoking a wrong base URL for invalidating the GF cache:
https://host/MapStore2/rest/geofence/ruleCache/invalidate

It should be something like as the cache rule is on the GS side:
https://host/geoserver/rest/geofence/ruleCache/invalidate

Rulemanager and the api code here are not considering multiple instances

addBaseUrlGS: function(options = {}, gsInstanceURL) {
// in case of stand-alone geofence, use gsInstanceURL
const isStandAloneGeofence = Api.getRuleServiceType() === 'geofence';
let {url: baseURL} = ConfigUtils.getDefaults().geoFenceGeoServerInstance || {};
if (isStandAloneGeofence && gsInstanceURL) {
baseURL = gsInstanceURL;
}
// ensure URL ends with a slash to prevent path issues
if (baseURL) {
baseURL = baseURL.endsWith("/") ? baseURL : baseURL + "/";
}
return Object.assign(options, {baseURL});
},

Image

the migration guideline is good

in case of multiple instances the baseUrl here is undefined ending up in the error above
https://github.com/geosolutions-it/MapStore2/blob/master/web/client/api/geoserver/GeoFence.js#L191

ACs

When clicking clear cache we:

  • list in a menu item all instance names
    • clicking on an instance will open the modal
    • the modal will tell which instance you are clearing cache
    • click on confirm will delete cache on that instance only
  • EXTRA add a voice in menu list that is called "clear all"
  • when clicked it will open the modal
  • it will show a message that will state "Do you want to clear cache of all geoserver instances?
  • if confirm an invalidate must be sent with correct url (/MapStore2 is not present)

What kind of improvement you want to add? (check one with "x", remove the others)

  • Minor changes to existing features
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Other useful information

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. self-assigned this
    on Apr 21, 2026
  2. added theissue type on Apr 21, 2026
  3. added this to the 2026.02.00 milestone on Apr 21, 2026
  4. assigned and unassigned on Apr 21, 2026
  5. added a commit that references this issue on Apr 22, 2026
  6. MV88 commented on Apr 22, 2026

    @MV88
    ContributorAuthor

    @ElenaGallo testable in DEV

  7. ElenaGallo commented on Apr 22, 2026

    @ElenaGallo
    Contributor

    @tdipisa The multiple instances feature is not enabled on MS Dev so this fix can not be tested. I will go test it in the client’s environment. ok?

  8. added a commit that references this issue on Apr 22, 2026
  9. added a commit that references this issue on Apr 22, 2026
  10. added a commit that references this issue on May 4, 2026
  11. added a commit that references this issue on May 31, 2026
  12. added a commit that references this issue on Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions