-
Notifications
You must be signed in to change notification settings - Fork 376
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
Wps results fix #6826
Wps results fix #6826
Conversation
Hey @sixlighthouses, that's some good sleuthing 🕵️ job. The root cause is that our workbench implementation is not protected from duplicate items - that might need a rethink at some point. The fix you made works, but I would suggest changing newItems to a Set<BaseModel> instead? It'll automatically guard against similar bugs in other code paths. You can then convert the set to array using |
thanks @na9da a set is a nice solution will make that change |
Hey @sixlighthouses, on another thought the better fix would be to make the set method for workbench.items sanitize its input by de-duplicating the input array. You could use the lodash Sorry if you already started on the fix. |
thanks @na9da updated the workbenches items set method |
Looks good @sixlighthouses. I have just made a couple of comments. |
CHANGES.md
Outdated
#### next release (8.3.2) | ||
#### next release (8.3.3) | ||
|
||
- Fixed a bug when restoring timefilter from a share link having more than one imagery item with the same base URL (but different layer names). | ||
- [The next improvement] | ||
|
||
#### 8.3.2 | ||
|
||
- Fix WPS duplicate display of analysis results when loaded through a share URL | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the correct next release for this change is 8.3.2
(so after the timefilter bug fix).
Lines 3 to 7 in 15d4686
#### next release (8.3.2) | |
- Fixed a bug when restoring timefilter from a share link having more than one imagery item with the same base URL (but different layer names). | |
- [The next improvement] | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go 🚀
Fix WPS duplicate
Fixes #6392
Workbench items were being duplicated when loaded from WPS results in share URL.
Added a check in models/Terria.ts when loading items to ensure duplicates are not added
Test me
Load this share URL http://ci.terria.io/wps-results-fix/#share=s-uCLMJuXtXBpFXvmJbBI4gE4rGUz
Two items should be loaded to the workbench

Checklist
doc/
.