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

Replay Vault: Some sort criteria cause API 400 error #1740

Closed
Askaholic opened this issue Jun 1, 2020 · 5 comments
Closed

Replay Vault: Some sort criteria cause API 400 error #1740

Askaholic opened this issue Jun 1, 2020 · 5 comments
Labels

Comments

@Askaholic
Copy link
Collaborator

Some of the sort options appear not to be supported by the API. Selecting any of

  • Max players
  • Map is ranked
  • Game mod name
  • Map width
  • Map height

will cause an error like this:

java.util.concurrent.CompletionException: org.springframework.web.client.HttpClientErrorException$BadRequest: 400 Bad Request
	at org.springframework.aop.interceptor.AsyncExecutionAspectSupport.lambda$doSubmit$3(AsyncExecutionAspectSupport.java:279)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.web.client.HttpClientErrorException$BadRequest: 400 Bad Request
	at org.springframework.web.client.HttpClientErrorException.create(HttpClientErrorException.java:79)
	at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:122)
	at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:102)
	at com.faforever.client.api.JsonApiErrorHandler.handleError(JsonApiErrorHandler.java:31)
	at org.springframework.security.oauth2.client.http.OAuth2ErrorHandler.handleError(OAuth2ErrorHandler.java:172)
	at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63)
	at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:778)
	at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:736)
	at org.springframework.security.oauth2.client.OAuth2RestTemplate.doExecute(OAuth2RestTemplate.java:128)
	at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:670)
	at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:311)
	at com.faforever.client.api.FafApiAccessorImpl.getPage(FafApiAccessorImpl.java:630)
	at com.faforever.client.api.FafApiAccessorImpl.getPage(FafApiAccessorImpl.java:617)
	at com.faforever.client.api.FafApiAccessorImpl.findReplaysByQuery(FafApiAccessorImpl.java:335)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:205)
	at com.sun.proxy.$Proxy70.findReplaysByQuery(Unknown Source)
	at com.faforever.client.remote.FafService.findReplaysByQuery(FafService.java:294)
	at com.faforever.client.remote.FafService$$FastClassBySpringCGLIB$$6c91c77e.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115)
	at org.springframework.aop.interceptor.AsyncExecutionAspectSupport.lambda$doSubmit$3(AsyncExecutionAspectSupport.java:276)
	... 4 more

If there is no way to make these sort parameters work, then I'd say just remove them from the options.

OS
Windows

Wanna have the bug fixed quickly?
Visit Issue hunt...
Issue hunt

@Askaholic Askaholic added the bug label Jun 1, 2020
@Brutus5000
Copy link
Member

A new version of Elide in the API now throws errors if you combine things that can't be combined logically (usually it's combination of join and sort). Before it just ignored it (and returned unpredictable results)

@Askaholic
Copy link
Collaborator Author

I should also specify that I tested this with searching for replays by player name “contains”.

So are you saying it’s possible for some of these sort criteria to work if I search by a different field like replay id?

@bukajsytlos
Copy link
Member

bukajsytlos commented Jun 1, 2020 via email

@Askaholic
Copy link
Collaborator Author

So theoretically the combinations that don’t work are well defined and could be removed or grayed out from the drop downs.

@Sheikah45
Copy link
Member

Fixed in #1947

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

No branches or pull requests

4 participants