BUG: Window.location.hostname can have bad values


#1

Window.location.hostname may get stuck on being blank, an IP address, or a URL instead of the correct HiFi domain name.

To reproduce: two avatars; teleport one to a different domain; quickly double-click avatar’s name in users.js list to TP to them.

Run a script with the following:

print("hostname = \"" + Window.location.hostname + "\"");

You’ll likely see that value reported is blank, a numerical IP address, or a text URL, instead of the proper HiFi domain name. And it stays this value even if you run the script again.

The location in Interface’s title bar may also not be the proper HiFi domain name.


#2

Yeah - this is same bug that makes the values in users.js bad. I’ll look into this tomorrow.


#3

@ctrlaltdavid I merged an API fix that at least fixes the issue I was seeing where you would jump to a user in a place and then it wouldn’t look like you were actually in that place.

Can you test this bug you’re describing and let me know if it is fixed?


#4

@b @birarda Unfortunately, I can still reproduce the bug. … Two avatars in hq. Teleport one to sandbox. In the other’s users.js list, double-click on the teleported avatar’s name before it changes to the new hostname. … I ended up with hostname == “” and “sandbox.highfidelity.io” in my Interface title bar (Windows build 2146). And my avatar is listed in users.js without a domain.


#5

@ctrlaltdavid - I’m getting an Invalid domain name error from your regex on line 294.

It’s saying ERROR: Invalid domain name: Heron

Not sure why as that’s, well, valid.


#6

@OmegaHeron Thanks. That’s a separate issue. I’ve just published a fixed chat.js.


#7

Thanks! Much appreciated.


#8

@ctralaltdavid - I still can’t send text. It won’t let me send it out.


#9

@OmegaHeron Check the domain name in your Interface titlebar: if it’s blank or a URL or IP address, chat.js won’t work because of the hostname bug. (Also make sure you’ve got the latest chat.js - I recommend running it direct from the URL so you always pick up the latest.)


#10

Thanks - trying that now. I had downloaded latest interface to be sure it was nothing to do with using self compiled version. Going back to see if my title bar is correct etc. And I am running from your URL.


#11

@ctralaltdavid

Window title shows OmegaHeron @ Heron (build dev)
script console:
print(Window.location.hostname);
Heron

Text in input area won’t send.


#12

@OmegaHeron Come over to sandbox. Can you do IRC chat?


#13

Okay - I see the issue you are experiencing - investigating.


#14

Alright - have a pull up with a fix for this.

We were double sending location update when changing to a new domain, and one of them didn’t respect the presence of place information. Sorry for the bug!


#15

@birarda Your PR’s in Windows build 2147 and it looks good! Nice and snappy. No more bad values. Thanks. : )