Skip to content

AsianHobbyist Fetch Search Encoding

Clocks requested to merge github/fork/Dunbock/fix-AH into dev

Created by: Dunbock

The search encoding changes sometimes. This changes it to get the encoding from the website.

The encoding gets fetched when the listing gets loaded as the website has been loaded at that point anyway. In case of someone either being fast enough to somehow skip loading the listing or doing a global search, I also added a fail safe in the search that loads the encoding in case it is not set already.

The following scenario I have come up with that would break this implementation:

  • The encoding gets set.
  • The encoding changes on the website and web server.
  • A search gets made (the listing does not get called cause due for example a global search, i.e. encoding does not get updated).
  • Search sees the encoding is set, therefore uses set encoding that is outdated.

The problem I see with fetching the encoding every time in search is that, from what I can tell, the search function gets triggered every time a letter changes in search query. Therefore, the website will get potentially spammed with request to ensure the latest encoding. Assuming the website does not get cached. Though then my example above would break search in that case too until the cache of the website gets dumped.

Whether this is a okay implementation or not therefore depends on the caching and how long a local variable gets kept.

Merge request reports