Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#8723 Fix for WMTS background issues due to attribution parameter; #8724 WMTS request identify flow fixes #8725

Merged

Conversation

alex-fko
Copy link
Contributor

Description

This PR applies minor changes to resolve following issues:
8723
8724

  • WMTS background requests were failing due to attribution parameter passed to the requests. While parameter itself doesn't break anything, having html tags in it makes tile requests fail. Applied changes just making sure that attribution is used by MapStore, but not being added to the request.
  • Features set displayed in identify results panels could possibly have feature with ref property. Such feature can potentially cause React exception because of props spreading in RowViewer component. With the applied changes ref property is omitted prior to spreading.
  • Click outside of the tile matrix is causing GetFeatureInfo request fail with 400 error. This error was not handled properly on the side of identify flow for WMTS layer. It resulted into epic error and complete outage of side-effects processing. Applied changes adding extra check to the identify flow for WMTS layers to make sure that error is processed properly if request fails because row/column is out of range.

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Issue

What is the current behavior?
8723
8724

What is the new behavior?
According to the description. Please refer to the example map/geoStory in referenced issues for testing.

Breaking change

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • Yes, and I documented them in migration notes
  • No

Other useful information

@alex-fko alex-fko self-assigned this Oct 24, 2022
@ale-cristofori ale-cristofori added the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label Oct 24, 2022
@ale-cristofori
Copy link
Contributor

@alex-fko once reviewed and tested needs backporting to 2022.01.xx

},
getIdentifyFlow: (layer, basePath, params) =>
Observable.defer(() => axios.get(basePath, { params }))
.catch((e) => {
Copy link
Member

Choose a reason for hiding this comment

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

Did you tested this? I'm afraid this catch will never be called because

  • errors are not trown, axios will receive a standard OGC error, that has HTTP status 200.
  • You are returning the Exception, or data, while catch requires to return an observable.

I'm afraid you added the code but you didn't tried it.

Something like this should work

.let(interceptOGCError) // from ObservableUtils
.catch(e => {
    // do things
    if(notManaged) { // if you can not manage exception.
         throw e;
    }
    return Observable.of({data: {features: []} } );
    // or, if not managed

});

should work. So you should add a unit test with the response and the expected result.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why would I add exception handler without even trying it?
It can be checked using #/geostory/41714
Here it is, thrown upon click outside of the area where data is available, status code is 400:
image

Copy link
Member

@offtherailz offtherailz Oct 25, 2022

Choose a reason for hiding this comment

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

Sorry, I didn't want to accuse of course :)
When I said "I'm afraid you added the code but you didn't tried it." I meant that you committed in error.
It is strange, usually they respond with 200. I had not data to try it, so I wasn't able to verify myself.
I will try with #/geostory/41714, thank you for clarifying
Anyway catch should return an Observable, not returning single values or error, at least returning an observable that emits these things. throw is a possibility, but depends on what it the function that uses it expect. I'll check.

Copy link
Member

Choose a reason for hiding this comment

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

Ok I tested it. Sorry my fault.
I did an error reading the code. Also returning exception I think it is ok. You can revert the changes.
Unit test should be added.

@offtherailz offtherailz self-requested a review October 25, 2022 13:05
Copy link
Member

@offtherailz offtherailz left a comment

Choose a reason for hiding this comment

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

Summarising our discussion, it seems that the withPopupSupport doesn't correctly support erroring responses.
We should verify any output format and check if the solution works also on mapviewer consistently with the error expected.

@alex-fko
Copy link
Contributor Author

@offtherailz I've added unit test to make sure it properly handles TileOutOfRange exception.
Extra check for plain text format is added to return expected response in that case; with these all three format types (plain text, json, html) works well. That's the last thing I've checked yesterday evening after exporting map from geoStory and importing it in viewer locally. Today, for some reason, I have errors on attempt to proxy responses to my local so I cannot recheck it now.

@offtherailz offtherailz merged commit 88c7ad8 into geosolutions-it:master Oct 26, 2022
@offtherailz
Copy link
Member

offtherailz commented Oct 26, 2022

@ElenaGallo, could you please test this on DEV ? Thank you. on dev we have #/geostory/41714 to use for testing

@offtherailz
Copy link
Member

@ale-cristofori @alex-fko told me this have to be backported to 2022.01.xx too.
Actually the release is not on zenhub anymore. So you have to remember on your own that this have to be backported to the old branch too.

@tdipisa
Copy link
Member

tdipisa commented Oct 26, 2022

@offtherailz @ale-cristofori connected issues are for bug fixes, therefore I guess these can land in 2022.02.01 and so backported to 2022.02.xx once tested in DEV.

@tdipisa tdipisa added this to the 2022.02.01 milestone Oct 26, 2022
@tdipisa
Copy link
Member

tdipisa commented Oct 26, 2022

@ElenaGallo please test the connected issues in DEV and let us know.

@ElenaGallo
Copy link
Contributor

Test passed, @alex-fko please backport to 2022.02.xx.Thanks

alex-fko added a commit to alex-fko/MapStore2 that referenced this pull request Oct 26, 2022
…on` parameter; geosolutions-it#8724 WMTS request identify flow fixes (geosolutions-it#8725)

(cherry picked from commit 88c7ad8)
alex-fko added a commit to alex-fko/MapStore2 that referenced this pull request Oct 26, 2022
…on` parameter; geosolutions-it#8724 WMTS request identify flow fixes (geosolutions-it#8725)

(cherry picked from commit 88c7ad8)
offtherailz pushed a commit that referenced this pull request Nov 2, 2022
offtherailz pushed a commit that referenced this pull request Nov 2, 2022
…8724 WMTS request identify flow fixes (#8725) (#8733)

(cherry picked from commit 88c7ad8)
@offtherailz
Copy link
Member

Backport has been merged.

@ElenaGallo ElenaGallo removed the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants