secondlife / jira-archive

2 stars 0 forks source link

[BUG-225356] Changed media event is not firing when the URL is amended by a '#' on post-Alex Ivy viewers. #4180

Open sl-service-account opened 6 years ago

sl-service-account commented 6 years ago

Please refer to this discussion on the forums: https://community.secondlife.com/forums/topic/426794-scripts-not-communicating-for-a-specific-user/

Short summary of the problem from the HUD creator

The system begins with a single prim with media (website) on a single face. When buttons on the webpage are pressed, the event is reflected in the webpage's URL through the addition of a '#' followed by some text - just like the use of internal links. A script in the hosting prim uses the 'changed' event to detect 'changed media'. When this event detects the addition of a '#', the text following it is parsed to interpret the command the script is to execute.

With the recent update, the changed media event is not firing when the URL is amended by a '#'.


I'm afraid my scripting isn't good enough to recreate a simple repro object, so the steps below show how to recreate the bug with the HUD created by @Vindictii.

Steps To Reproduce

Attachments

Original Jira Fields | Field | Value | | ------------- | ------------- | | Issue | BUG-225356 | | Summary | Changed media event is not firing when the URL is amended by a '#' on post-Alex Ivy viewers. | | Type | Bug | | Priority | Unset | | Status | Accepted | | Resolution | Accepted | | Reporter | Whirly Fizzle (whirly.fizzle) | | Created at | 2018-08-28T17:08:35Z | | Updated at | 2018-09-07T14:33:32Z | ``` { 'Build Id': 'unset', 'Business Unit': ['Platform'], 'Date of First Response': '2018-08-28T13:39:42.070-0500', "Is there anything you'd like to add?": 'Bloody bloody media bugs', 'ReOpened Count': 0.0, 'Severity': 'Unset', 'System': 'SL Viewer', 'Target Viewer Version': 'viewer-development', 'What just happened?': 'Media....', 'What were you doing when it happened?': 'Bloody media...', 'What were you expecting to happen instead?': 'Seriously, bloody media....', 'Where': 'Any region', } ```
sl-service-account commented 6 years ago

Chaser Zaks commented at 2018-08-28T18:39:42Z, updated at 2018-08-28T18:41:18Z

I put a thingy west bound of http://maps.secondlife.com/secondlife/Testylvania%20Sandbox/108/161/21 which appears to reproduce this from the description. Object and scripts are full perm and shared with the Testylvanian group if need be to poke at the thing.

From a web development standpoint, updating(not replacing) the URL in CEF would make sense as it follows anchor links and triggers the "hashchange" window event in javascript. Example implementation on how this would be fixed(in pseudo code):


//Example URL: https://secondlife.com/example/document.htm?key=value#anything
//Splitting it into a "path" would cause:
//origin: <protocol>://<host>[:port] (https://secondlife.com)
//pathname: [slash separated string] (/example/document.htm)
//querystring: [?[key=value[&...]]
//hashstring: [#[anything]]

path currentUrl;
media change message(path url)
    if(url.origin == currentUrl.origin && url.pathname == currentUrl.pathname && url.querystring == currentUrl.querystring)
        if(url.hashstring != currentUrl.hashstring)
            update url(Cause the "hashchange" window event, don't cause a navigation event(refresh/reload/etc))

        //else do nothing

    else
        replace url(Cause navigation event)

    currentUrl = url;
sl-service-account commented 6 years ago

Whirly Fizzle commented at 2018-08-28T21:06:29Z

Confirmed Chaser's test page at https://felix.softhyena.com/BUG-225356.htm reproduces the bug on post-Alex Ivy viewers but not on pre-Alex Ivy viewers.

Clicking on the bottom ?test link followed by the top #test link.

sl-service-account commented 6 years ago

Oz Linden commented at 2018-09-05T16:03:55Z, updated at 2018-09-05T22:20:58Z

Can you make a simple LSL script that illustrates the problem without picking up all of a HUD?

and it would appear from Chasers demo that appending/modifying a query parameter does still generate the Changed event.  Is there a reason why you can't use that?  There's nothing wrong with the server ignoring parameters it doesn't care about.

sl-service-account commented 6 years ago

Whirly Fizzle commented at 2018-09-07T14:33:32Z