Gaffer icon indicating copy to clipboard operation
Gaffer copied to clipboard

ProxyStore fails to deserialise JSON for Operations with a generic output type

Open p013570 opened this issue 7 years ago • 5 comments

An OperationChain consisting of [GetElements, Limit(10)] has a generic output type of Iterable<T>. This means the Proxy Store doesn't know to deserialise the objects into Elements.

p013570 avatar Dec 13 '17 22:12 p013570

Current status: To resolve a useful output type from a list of Operations in an OperationChain, the getOutputTypeReference will: Iterate through the operations in reverse Search for implementations of Output Ignore any with TypeReferences of type TypeReferenceImpl.IterableObj (since this doesn't really help for deserialisation) Return the TypeReference closest to the end of the chain if present, otherwise TypeReferenceImpl.Void

Whomever picks this up, feel free to reuse, change, or remove the above.

m607123 avatar Mar 22 '18 14:03 m607123

@GCHQDev404 Is this issue still valid or has this been fixed by other work?

n3101 avatar Jun 09 '21 17:06 n3101

After discussion offline, this bug is probably unaffected by fedstore rewrite and/or maestro. After maestro has been merged, revisit this bug and fix for alpha-5.

@GCHQDev404: "why is proxy even trying to deserialise it" @d21211122: "there are some tricks played with the generics so that when you construct operation chains with the builders, you get the correct generic types and the code will run correctly... but you lose those generics whenever that object is serialised" GCHQDev404: "some of those generics was getting ripped out" d21211122: "i suspect the issue is more about whether the output of one operation can be chained to another one without it failing".

n3101 avatar Jan 19 '22 18:01 n3101

A test needs to be written to examine if this bug still exists.

There appears to be some issues with such as #2806 where proxy store is having issues deserialising. Originally this was useful because the the Proxy could examine if it could or should handle something locally. In the real world maybe this is never used.

Maybe it would be simpler if proxy store or version of it was completely gutted out and forwards without deserialising anything.

GCHQDev404 avatar Jan 11 '23 13:01 GCHQDev404

This has been tested on a Rest service Federation Container with a Proxy to a Accumulo Store Container. And it works without issue. Testings is required for Java API but this deprioritised to after V2.

GCHQDev404 avatar Feb 03 '23 11:02 GCHQDev404