Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

Search for minimum bin not working. #204

Closed
furkick opened this issue Nov 18, 2019 · 8 comments
Closed

Search for minimum bin not working. #204

furkick opened this issue Nov 18, 2019 · 8 comments

Comments

@furkick
Copy link
Contributor

furkick commented Nov 18, 2019

READ BEFORE YOU ADD AN ISSUE: Do not request autobuyer features, because they are considered as cheating. Issues regarding autobuyers will be closed immediately.

Expected behavior:

Click on search minimum BIN, returns minimum BIN

Current behavior:

Click on search minimum BIN, hangs at searching minimum BIN....

Metadata:

  • Script version: 1.6.2
  • Browser: Chrome Version 78.0.3904.97 (Official Build) (64-bit)
  • OS: Windows 10 64-bit

To Reproduce

Steps to reproduce the behavior:

  1. Go to transfers page.
  2. Click on any player.
  3. Click search minimum BIN button.
  4. See error.

Screenshots

Capture

Error:

transferobjects is not defined.
const searchCriteria = new transferobjects.SearchCriteria();

@Mardaneus86
Copy link
Owner

If anyone can create a PR for this, please do! I have no time to work on this right now unfortunately.

@furkick
Copy link
Contributor Author

furkick commented Nov 18, 2019

Hi, So I've been digging and seems the following queries the transfer list, but there is an issue when selecting a player after doing it the first time, seems the BIN price does not return correctly from the second time onwards. Although if you wait say a minute+ then it randomly works sometimes. I'll have another look when I get some free time.

Replace:

const searchCriteria = new transferobjects.SearchCriteria()

With:

// eslint-disable-next-line no-undef 
const searchCriteria = new UTSearchCriteriaDTO();

@CasperSchjoett
Copy link

I'm not even able to query any player BINS at all, so i find it weird that you're actually able to query the first you choose.

@furkick furkick closed this as completed Nov 20, 2019
@furkick furkick reopened this Nov 20, 2019
@furkick
Copy link
Contributor Author

furkick commented Nov 20, 2019

The line of code modified shown in my post did query the first attempt successfully but had unusual behaviour after that. I haven't had time to look at this any further. If you replace the line shown and rebuilt the app then you should get the same results.

@guiseppeshen
Copy link

"Although if you wait say a minute+ then it randomly works sometimes. "

You can force it to 'redo' the second search properly by pressing compare price first and then pressing search minimum bin. Almost as if that "clears the cache".

Maybe that can help you to understand the problem.

@CasperSchjoett
Copy link

The line of code modified shown in my post did query the first attempt successfully but had unusual behaviour after that. I haven't had time to look at this any further. If you replace the line shown and rebuilt the app then you should get the same results.

I'm not familiar with JavaScript so i have no idea where and how to change the variable, sadly.

@furkick
Copy link
Contributor Author

furkick commented Nov 20, 2019

So it seems the problem lies somewhere in the following:

services.Item.searchTransferMarket

When searching for a player after successfully getting a BIN the first time (as described before) the function seems to return information based on the first player searched for, not the second. I have hacked about at it and can get it to work if you put in a large delay 10 seconds+ in the async _findLowDown function.

As @guiseppeshen mentioned it seems there may be a cache of some sort and after adding a large delay this seems to clear.

furkick added a commit to furkick/futwebapp-tampermonkey that referenced this issue Nov 20, 2019
- Clear transfer cache before querying market.
- Use new DTO.
@furkick
Copy link
Contributor Author

furkick commented Nov 20, 2019

@Mardaneus86 Spot on with the cache, I have tested with multiple use cases and seems to be fixed now. PR: #205

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

No branches or pull requests

4 participants