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

Potential Edge-Case with JSON.Simple, potentially affecting MojangAPI, BukkitTools, and GatherResidentUUIDTask #5375

Closed
TheFlagCourier opened this issue Oct 17, 2021 · 3 comments · Fixed by #5378

Comments

@TheFlagCourier
Copy link
Member

Traditional bug report form skipped due to: a) I am not entirely sure how to reliably test this specific issue due to potential interference with the player cache; b) The issue was discovered while tweaking the pom file; c) It's way too early in the morning (4am 💀)

Summary

I may have found a previously undocumented edge-case issue with the GatherResidentUUIDTask. Debated on if I should have added this wall of text to #4611, or made a new issue...

The only things keeping the whole chain working seem to be the VaultAPI dependency, since it directly bundles a copy of Bukkit 1.13.1 which in turn provides the needed dependency, and the Player Cache.

Replicating Issue

The issue is noticeable during the build process. By adding the following to the pom.xml, in the VaultAPI dependency declaration, and attempting a clean compile - the build will error-out due to missing the dependency.

<exclusions>
  <exclusion>
    <groupId>org.bukkit</groupId>
    <artifactId>bukkit</artifactId>
  </exclusion>
</exclusions>

I have not been able to test in-game yet (see disclaimer 'C' above). Theoretically though, if someone doesn't have Vault (eg. Reserve users) or something else providing JSON.Simple, and the UUID isn't already stored in the player cache, a failure should occur. At runtime, I suspect that this may be causing a MojangException to be thrown, which may have helped mask the issue as an "HTTP 204 error" or passed it as null which would have resulted in an infinitely reattempted task chain.

Methods Under Effect

  • BukkitTools#getUUIDFromResident(Resident)
  • MojangAPI#send(String)

Possible Solutions

  • Shade in a copy of JSON.Simple

    <dependency>
      <groupId>com.googlecode.json-simple</groupId>
      <artifactId>json-simple</artifactId>
      <version>1.1.1</version>
      <scope>compile</scope>
    </dependency>
  • Switch to GSON (Provided by Bukkit; in "Maintenance Mode")

  • Use an entirely different JSON serializer, like Jackson or Moshi

@Warriorrrr
Copy link
Member

Made a commit that potentially fixes this (3b96526) by switching it to gson, haven't tested it on a server yet.

@LlmDl
Copy link
Member

LlmDl commented Oct 17, 2021

It'll be interesting to see if this clears up the 204 response, post-merge I can test one of the larger databases that does end up throwing those 204's (but on deleted accounts)

@LlmDl
Copy link
Member

LlmDl commented Oct 17, 2021

It does not clean up the 204 response issue.

@LlmDl LlmDl added this to the 0.97.3.0 milestone Oct 17, 2021
LlmDl added a commit that referenced this issue Oct 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants