Skip to content

Conversation

@ltkum
Copy link
Contributor

@ltkum ltkum commented Nov 17, 2025

Issue: When loading an external WMS layer, the initial values (like the visibility or opacity) were not passed to the layer, which meant that on startup, we would automatically lose their initial state.

Fix: We add the initial values as parameters to the makeExternalWMSLayer function.

Test link

@ltkum ltkum requested a review from pakb November 17, 2025 18:17
@github-actions github-actions bot added the bug label Nov 17, 2025
@cypress
Copy link

cypress bot commented Nov 17, 2025

web-mapviewer    Run #6193

Run Properties:  status check errored Errored #6193  •  git commit ac5fdc4262: PB-1383: layer tests
Project web-mapviewer
Branch Review fix-PB-1383-no-external-layers-params
Run status status check errored Errored #6193
Run duration 12m 42s
Commit git commit ac5fdc4262: PB-1383: layer tests
Committer Martin Künzi
View all properties for this run ↗︎

Test results
Tests that failed  Failures 44
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 19
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 160
View all changes introduced in this branch ↗︎

Tests for review

Failed  drawing.cy.ts • 1 failed test • e2e/chrome/mobile

View Output

Test Artifacts
An uncaught error was detected outside of a test Test Replay Screenshots
Failed  legacyParamImport.cy.ts • 1 failed test • e2e/chrome/mobile

View Output

Test Artifacts
An uncaught error was detected outside of a test Test Replay Screenshots
Failed  3d/layers.cy.ts • 10 failed tests • e2e/chrome/mobile

View Output

Test Artifacts
Test of layer handling in 3D > add layer from search bar Test Replay Screenshots
Test of layer handling in 3D > sets the opacity to the value defined in the layers URL param or menu UI Test Replay Screenshots
Test of layer handling in 3D > sets the timestamp of a layer when specified in the layers URL param Test Replay Screenshots
Test of layer handling in 3D > reorders visible layers when corresponding buttons are pressed Test Replay Screenshots
Test of layer handling in 3D > add GeoJson layer with opacity from URL param Test Replay Screenshots
Test of layer handling in 3D > removes a layer from the visible layers when the "remove" button is pressed Test Replay Screenshots
Test of layer handling in 3D > uses the 3D configuration of a layer if one exists Test Replay Screenshots
Test of layer handling in 3D > add KML layer from drawing Test Replay Screenshots
Test of layer handling in 3D > Verify layer features in 2D and 3D Test Replay Screenshots
Test of layer handling in 3D > Verify a layer with EPSG:4326(WEBMERCATOR) bounding box in 2D and 3D Test Replay Screenshots
Failed  changeLanguage.cy.ts • 1 failed test • e2e/chrome/mobile

View Output

Test Artifacts
An uncaught error was detected outside of a test Test Replay Screenshots
Failed  header.cy.ts • 1 failed test • e2e/chrome/mobile

View Output

Test Artifacts
An uncaught error was detected outside of a test Test Replay Screenshots

The first 5 failed specs are shown, see all 23 specs in Cypress Cloud.

Copy link
Contributor

@pakb pakb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you broke a unit test, please fix it

@ltkum ltkum force-pushed the fix-PB-1383-no-external-layers-params branch 3 times, most recently from 8d8a697 to 6c7fe50 Compare November 24, 2025 07:35
@ltkum ltkum requested a review from pakb November 24, 2025 08:34
@ltkum ltkum force-pushed the fix-PB-1383-no-external-layers-params branch 2 times, most recently from 7c9e72d to a1df253 Compare November 27, 2025 09:50
@ltkum ltkum force-pushed the fix-PB-1383-no-external-layers-params branch 2 times, most recently from 7c4ddd7 to a287cb9 Compare November 28, 2025 09:08
@ltkum ltkum requested a review from pakb November 28, 2025 09:10
try {
layerOptions = optionsFromCapabilities(capabilities, {layer: attributes.id, projection: outputProjection.epsg})
} catch (exception) {
const msg = `issue while getting the options from capabilities : ${exception?.toString()}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to create a variable as you are only using it once

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the optionsFromCapabilities can create exceptions (for example: when getAxisOrientation() returns null, which happened in some tests). Without the try catch, layers which are defined in the capabilities won't load, and won't be shown.

If the axisOrientation is a mandatory part of any wmts layer, then we can revert this change and fix our fixtures instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so, turns out the issue was linked to a lack of registration of the swiss projection. We can either keep a try catch around the options to have some more logging, or consider the existing logging is sufficient enough.

@sommerfe sommerfe force-pushed the feat-PB-1383-pinia-store branch from a1cccff to 9e6d8d7 Compare December 2, 2025 08:43
@ltkum ltkum force-pushed the fix-PB-1383-no-external-layers-params branch 2 times, most recently from b7a7534 to 3228bdd Compare December 8, 2025 16:53
@ltkum ltkum requested a review from pakb December 8, 2025 16:55
@ltkum ltkum force-pushed the fix-PB-1383-no-external-layers-params branch 3 times, most recently from 20fb715 to ac5fdc4 Compare December 9, 2025 12:51
Issue: When loading an external WMS layer, the initial values (like the visibility or opacity) were not passed to the layer, which meant that on startup, we would automatically lose their initial state.

Fix: We add the initial values as parameters to the `makeExternalWMSLayer` function.
Issue: When starting the app for the first time, the URL sync plugin would start
being active before the topics were fully set, causing (mainly) the background layer
parameter to be ignored and replaced with the topic's default one

Fix: The `ConfigLoaded` state now wait for the background layer to be set before
being fulfilled.
small modifications to the loading of topics, there was a case where it would refuse to set up the default background on startup
- some more tests coverage corrections
- removal of some useless comments
- adding some comments to tell people why some changes have happened
- some more tests coverage corrections
- removal of some useless comments
- adding some comments to tell people why some changes have happened

PB-1383: adding proj4 registration to layers so openlayers supports layers with only swiss projections

- Issue with the drag and drop reordering test: when it was called alone, it would pass, when it would be called after the one reordering layers with the buttons, it would fail because a menu popup would show which was not planned. Rather than place a "force" which could pass even if the element is somehow obscured for a non legitimate reason, I switched the order of the tests
- Issue with the call of layer capabilities: We've changed the number of expected calls in the tests, as the capabilities are called once per layer, not once in total. If we need to rework the capabilities handling, we'll have to change this test once again.
@ltkum ltkum force-pushed the fix-PB-1383-no-external-layers-params branch from ac5fdc4 to ecda228 Compare December 12, 2025 09:46
@ltkum ltkum merged commit d345131 into feat-PB-1383-pinia-store Dec 12, 2025
4 of 6 checks passed
@ltkum ltkum deleted the fix-PB-1383-no-external-layers-params branch December 12, 2025 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants