Skip to content

BGDIINF_SB-2729: Added multiple KML edit and simplify KML drawing logic#326

Merged
ltshb merged 5 commits intodevelopfrom
feat-BGDIINF_SB-2729-multiple-kml
Dec 21, 2022
Merged

BGDIINF_SB-2729: Added multiple KML edit and simplify KML drawing logic#326
ltshb merged 5 commits intodevelopfrom
feat-BGDIINF_SB-2729-multiple-kml

Conversation

@ltshb
Copy link
Contributor

@ltshb ltshb commented Dec 19, 2022

@ltshb ltshb force-pushed the feat-BGDIINF_SB-2729-multiple-kml branch 5 times, most recently from fee2ed3 to 7ece86a Compare December 21, 2022 08:16
@ltshb ltshb force-pushed the bug-BGDIINF_SB-2668-empty-drawing branch from 2229f73 to 2a8ced7 Compare December 21, 2022 08:38
@ltshb ltshb force-pushed the feat-BGDIINF_SB-2729-multiple-kml branch from 7ece86a to f3f8cc5 Compare December 21, 2022 08:41
@ltshb ltshb marked this pull request as ready for review December 21, 2022 08:57
@ltshb ltshb requested review from jedef and pakb December 21, 2022 08:57
Base automatically changed from bug-BGDIINF_SB-2668-empty-drawing to develop December 21, 2022 10:50
@ltshb ltshb force-pushed the feat-BGDIINF_SB-2729-multiple-kml branch from f3f8cc5 to 5548495 Compare December 21, 2022 10:50
@ltshb ltshb force-pushed the feat-BGDIINF_SB-2729-multiple-kml branch from 5548495 to 800cc20 Compare December 21, 2022 15:24
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.

very nice! thanks a lot

When creating a KML add the author version.

Added get KML metadata from backend API helper
Before when the from the backend failed you couldn't close the drawing menu
and the error status was not displayed. Also when an error happened outside the
toggling of the show drawing menu, the exception was not catch.

Now we simply set the status to ERROR and re-trigger an update later on.
@ltshb ltshb force-pushed the feat-BGDIINF_SB-2729-multiple-kml branch from 800cc20 to 7b2e701 Compare December 21, 2022 18:35
@ltshb ltshb merged commit 38bc3c4 into develop Dec 21, 2022
@ltshb ltshb deleted the feat-BGDIINF_SB-2729-multiple-kml branch December 21, 2022 18:50
Copy link
Contributor

@jedef jedef left a comment

Choose a reason for hiding this comment

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

Hello
I could not finish the review today, as there are many changes. But I will still publish the comments that I have already added.

I have seen that you have not added any comments to explain that the savingStatus is for indicative uses only and is not always correct (see the comment in #325). Do you think that it is not necessary?

throw e
}
if (this.savingStatus !== SavingStatus.UNSAVED_CHANGES) {
this.savingStatus = SavingStatus.SAVED
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no grarantee that during the saving of the drawing, the user does not do any modifications that lead to unsaved changes. So I would not remove this if statement. (But you can put it in the try statement if you want)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point I modify this in #331

await this.addKmlDrawingLayer(layer)
// Remove the layer to not have an overlap with the drawing from
// the drawing manager
this.removeLayer(layer)
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that you have moved out all the logic of this function (addKmlLayerToDrawing), why not fusion it with addKmlDrawingLayer? This would also remove the confusion with the two very similar names.

if (this.abortedToggleOverlay) {
this.abortedToggleOverlay = false
return
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Removing this protection while retrying the saving automatically when the prior saving failed (line 316) is very dangerous. Because now if you loose the internet connection and quit the drawing, not only will you loose your changes, but in the background the drawing module will still continuousely try to save the drawing. So when the internet connection comes again, as the drawing layer is empty when not in drawing mode, it will overwrite your kml drawing with a blank one.
So I would either improve the saving retry policy so that it stops to try to save the drawing when quitting the drawing mode, or readd the above protection, or both. Or/and clear the kml metadata when quitting drawing mode to prevent any accidental overwriting of the kml.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed this protection as it did not work correctly. It simply prevented to close the menu without retry of the failed saved and during my test (I changed the url of the backend to force a failed saving) the error message was not displayed. So that was not very user friendly as you could not do the action that you want without any indication why. I did not debug to see why the saving status of error was not displayed though.
I think we should not try to make decision for the user, this will not be understood. Automatic retry on auto save is the best IMHO.
However you brought a very good point with the auto retry continuing when the drawing menu is closed ! I'll fix this, see #331

ltshb added a commit that referenced this pull request Dec 22, 2022
ltshb added a commit that referenced this pull request Dec 22, 2022
ltshb added a commit that referenced this pull request Dec 22, 2022
ltshb added a commit that referenced this pull request Dec 22, 2022
ltshb added a commit that referenced this pull request Dec 22, 2022
ltshb added a commit that referenced this pull request Dec 22, 2022
BGDIINF_SB-2729: Fixed save KML drawing error handling - from post review of #326
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