xyzz / acquisition

http://get.acquisition.today/
GNU General Public License v3.0
269 stars 98 forks source link

Getting an unwanted warning: " Can't extract selected character name from the page ". #301

Open thaleseaf opened 8 years ago

thaleseaf commented 8 years ago

Hey there, so I finally managed to set up my store via acquisition, hoping people would see my items on poe.trade. The problem is that I'm receiving a warning like this every other minute: " WARN 2016-04-11T06:59:29.814 Can't extract selected character name from the page " I have no clue what this is, tried looking for it but usually the ones that made the same post stop answering so.. there's no solution yet I guess? Everything seems to be working, all my items shows up from inventory and stash tabs, and the shop thread in the forums is updating, poe.trade is working fine too. I'm sorry my english is kinda bad since it's not my first language.

ericsium commented 8 years ago

Can you do the following. In chrome go to 'pathofexile.com' and login as usual and make sure you can see your currently selected character at the top of the page. Click the 'options' thingy in upper right (three horizonal bars) and select 'More Tools' -> 'Developer Tools'.

Click somewhere in the html text in the left developer box to acivate that window.

Press 'Ctrl+f' to start a find in that box and search for 'activeChar'. It will jump to a section with some JSON encoded text. Right click on that text and select 'copy element'. Go to pastebin.com paste in that text and let me know the link.

thaleseaf commented 8 years ago

Gonna do it in firefox (don't use chrome, if I must switch to chrome tell me and then I will download it). My character is currently selected at the top of the page. I think I've done everything right, here's the link: http://pastebin.com/ggdZfPw4

ericsium commented 8 years ago

I tested just that text in isolation and the code has no issues extracting your character.

Basically this code is failing for some reason: https://github.com/xyzz/acquisition/blob/master/src/util.cpp#L94

It's called here: https://github.com/xyzz/acquisition/blob/master/src/itemsmanagerworker.cpp#L147

The inputs and outputs are fairly static. The only real variable here is the page fetch for your account, for some reason the page is different and causing the code to fail to extract the page.

If you're handy with C++ you could save the HTML page to a text file, take that function and write a little C++ program to debug. Else you can pastebin that whole page request and I can try to test that input.

ericsium commented 8 years ago

My guess is that it's possibly non-deterministic in some cases whether 'league' actually follows 'name' in the JSON string. Either that or ,"league is being found elswhere in the page in your case before activeCharacter string.

thaleseaf commented 8 years ago

yeah I don't know a thing about C++ or anything. But I may have a clue. I made a character in path of exile, then deleted it and made this one with the same nickname/class, maybe that's related? Idk. Here's the pastebin (I guess I copied everything but I'm not sure, I really didn't know what I was doing) http://pastebin.com/xKh3bHGf

ericsium commented 8 years ago

With that text it was able to extract your character name okay, of course that was from firefox and doesn't really show us what the request looks like in game (although it should be the same). I can't do that much now without adding debug code to the app itself.

Can you try switching to another active character in that league and trying it? Also, just to confirm are you logging into Aquisition in 'Perandus' league as well and that's the shop you're working with?

thaleseaf commented 8 years ago

yeah I'm logging in at Perandus league as well as the shop, the acquisition program is working fine, some people contacted me already via poe.trade, I just don't know the implications this warning message could have. I'm gonna make a new character then and try to see if I get the warning, 1 sec

thaleseaf commented 8 years ago

Switched characters, made a new shopping thread which updates fine, everything seems to be working fine but get the same error message : " WARN 2016-04-11T14:43:03.315 Can't extract selected character name from the page ". It seems to have no effect whatsoever, just an annoying warning message.

ericsium commented 8 years ago

You switched the characters on the webpage to the different char and same issue? Yeah, it shouldn't have any functional issues other than it may not load your characters. Your regular tabs should be loaded fine. I'll mark this as 'bug' with the resolution to add some debug features so things like this can be more easily debugged.

I'd like to get some beta testers for new versions, let me know if you're interested and I'll let you know when we have a beta version that has more debug info and we'll see if we can solve it then.

thaleseaf commented 8 years ago

Yeah it doesn't seem to have any impact. It loads the items from the stash AND the ones equipped or in the inventory. It's just odd for me. Welp my english skills are kinda bad but if I can help surely I would like to.

alc0h0lic commented 8 years ago

Hi,

I have same bug and acquisition does not load tabs.

grach3v commented 8 years ago

Hi, I have the same problem!