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

Improving notification message when sending/importing keys that are duplicated ? #45

Open
Rdornier opened this issue Sep 19, 2024 · 0 comments

Comments

@Rdornier
Copy link

When importing or sending key-values from/to OMERO, the menu gives the option to replace existing values. But if the keys are duplicated on OMERO :

  1. Case 1 : when importing KVP to QuPath, no qpmetadata are created because of the key duplication on OMERO
  2. Case 2 : when sending duplicate keys on OMERO, a new key (i.e. triplicate) is created, with the new value from QuPath

This is ok for me, but the notifications don't exactly reflect this behavior

Case 1

image

This is not really the case, because of the duplicate keys. A warning is logged in the logger but I think it will be better to also have a warning notification telling the user that no keys were imported for this image.

Error when reading {"id":3411,"ns":"openmicroscopy.org/omero/client/mapAnnotation","name":null,"description":null,"owner":{"id":152},"date":"2024-09-19T14:30:22+01:00","permissions":{"canDelete":true,"canAnnotate":true,"canLink":true,"canEdit":true},"link":{"id":5208,"owner":{"id":152},"parent":{"id":3347,"class":"ImageI","name":"NEDD1_Centrin_004_SIR_PRJ.dv"},"date":"2024-09-19T14:30:22+01:00","permissions":{"canDelete":true,"canAnnotate":true,"canLink":true,"canEdit":true}},"class":"MapAnnotationI","values":[["test","afa"],["test1","sdvsv"],["test","DVSVS"]]}
com.google.gson.JsonSyntaxException: duplicate key: test
	at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:176)
	at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:144)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.readIntoField(ReflectiveTypeAdapterFactory.java:212)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$FieldReflectionAdapter.readField(ReflectiveTypeAdapterFactory.java:433)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:393)
	at com.google.gson.Gson.fromJson(Gson.java:1227)
	at com.google.gson.Gson.fromJson(Gson.java:1329)
	at com.google.gson.Gson.fromJson(Gson.java:1300)
	at com.google.gson.internal.bind.TreeTypeAdapter$GsonContextImpl.deserialize(TreeTypeAdapter.java:179)
	at qupath.ext.omero.core.entities.annotations.Annotation$GsonOmeroAnnotationDeserializer.deserialize(Annotation.java:93)
	at qupath.ext.omero.core.entities.annotations.Annotation$GsonOmeroAnnotationDeserializer.deserialize(Annotation.java:84)
	at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:76)
	at com.google.gson.Gson.fromJson(Gson.java:1227)
	at com.google.gson.Gson.fromJson(Gson.java:1329)
	at com.google.gson.Gson.fromJson(Gson.java:1271)
	at qupath.ext.omero.core.entities.annotations.AnnotationGroup.createAnnotations(AnnotationGroup.java:85)
	at qupath.ext.omero.core.entities.annotations.AnnotationGroup.<init>(AnnotationGroup.java:28)
	at java.base/java.util.Optional.map(Unknown Source)
	at qupath.ext.omero.core.apis.WebclientApi.lambda$getAnnotations$3(WebclientApi.java:216)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.postFire(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)

Case 2

image

This is true, but it could maybe mention that the keys were not replaced because they are duplicated and all duplicated keys are added in OMERO as a new KVP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant