Incorrect Error Received: Invalid Async After Seconds during Cancellation of Async
Incorrect Error is being received when cancelling the Async Request
Expected Behavior
The CANCELLATION should happen without any error.
Current Behavior
CANCELLATION Throws an Error: Invalid Async After Seconds
Possible Solution
Currently in ASYNCAPI models we default the AsyncAfterSeconds to 10. So if a user overrides the default time in Application.yaml to anything lower than 10 seconds we get this error. AsyncAfterSeconds is a transient field so during the update the user will not be passing its value again so a default value is used again.
Instead of hardcoding the default value to 10 in the model. we should have a getMethod that checks if the user has set a value in application.yaml. If there is a value set there then use it else use 10.
User has supplied a value at Query Time
--- Yes --> Use That
--- No --> Check for default value in Application.Yaml/Standalone Properties.
---> Value Found --> Yes ---> Use that as the default Value
--> No ---> 10 seconds
To make this to work for both spring and standalone, I recommend we add the user-supplied Configuration value to AsyncExecutorService or AsyncAPIHook and then retrieve from there in the model.
This will be a temporary solution till we make all the properties from Application.Yaml/Standalone Properties available in the ElideSettings object
Steps to Reproduce (for bugs)
- In
application.yamlsetmaxAsyncAfterSeconds: 1 - Run a mutation to cancel an existing query:
mutation ($id: ID) { asyncQuery(op: UPDATE, data: {id: $id, status: CANCELLED}) { edges { node { id status __typename } __typename } __typename } }
Context
A bug raised by Yavin User (Kevin Hinterlong @kevinhinterlong)