<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>164334</bug_id>
          
          <creation_ts>2016-11-02 13:26:23 -0700</creation_ts>
          <short_desc>Web Inspector: URL Breakpoints that resolve in multiple workers should only appear in the UI once</short_desc>
          <delta_ts>2016-11-15 13:38:50 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joseph Pecoraro">joepeck</reporter>
          <assigned_to name="Joseph Pecoraro">joepeck</assigned_to>
          <cc>bburg</cc>
    
    <cc>commit-queue</cc>
    
    <cc>joepeck</cc>
    
    <cc>mattbaker</cc>
    
    <cc>nvasilyev</cc>
    
    <cc>timothy</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1247442</commentid>
    <comment_count>0</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2016-11-02 13:26:23 -0700</bug_when>
    <thetext>Summary:
URL Breakpoints that resolve in multiple workers should only appear in the UI once

Steps to Reproduce:
1. Inspect &lt;https://nerget.com/rayjs-mt/rayjs.html&gt;
2. With 4 Renderers click &quot;Go!&quot; to spawn workers render
3. Set a breakpoint at render-task.js:14
4. Reload
5. Click &quot;Go!&quot;
  =&gt; Breakpoint resolves in each new worker and shows up 4 times in the UI

Notes:
- We should refactor and harden Breakpoints by URL more generally.
- Clicking the gutter to set a breakpoint almost always (95%+) sets a breakpoint by URL. This is necessary to restore the breakpoint when reloading / navigating the page and hitting the breakpoint. So URL is almost always the right solution.
- Any Breakpoint by URL may resolve to MULTIPLE locations
  - A page with multiple workers loading the same script (worker.js) will resolve the breakpoint to the same location but each tied to the different Worker target.
  - A page that loads the same URL (script.php) with different comments may resolve the breakpoint to different locations in each. This is rare and admittedly poor use of URLs and so rare that I don&apos;t think we should concern ourselves with this.

I think the relationship between objects is:

    DebuggerManager
      - N Breakpoints

    Breakpoint (by URL)
      - 1 Set Location (&quot;URL:line:column&quot;)
      - N Resolved Locations (sourceCodeLocation)
        - target1:script:line:column
        - target2:script:line:column
        - target3:script:line:column

    Breakpoint (by ScriptIdentifier)
      - 1 Set Location (target:scriptId:line:column)
      - At most 1 Resolved Location (sourceCodeLocation)

This impacts the current &quot;Breakpoint.resolved&quot; state. It seems &quot;resolved&quot; should move to a computed property based on whether or not there are _any resolved locations_. Likewise the list of _unique locations_ would be better to show in the UI, instead of all the resolved locations on which there may be multiple script:line:column duplicates just in different targets.

We could provide a way to enable/disable a breakpoint per-target, but that seems like such a rare case that we shouldn&apos;t provide that option.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1247443</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2016-11-02 13:26:33 -0700</bug_when>
    <thetext>&lt;rdar://problem/29073523&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1251529</commentid>
    <comment_count>2</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2016-11-15 11:47:59 -0800</bug_when>
    <thetext>Hmm, so I have a simple fix to address this for now. I do want to cleanup the Model objects a bit though.

I&apos;m thinking something like:

    Breakpoint
      - identifier : string
      - userLocation : SourceCodeLocation
      - resolvedLocations : [SourceCodeLocation]

One fortunate thing is that URL breakpoints get the same breakpoint identifier across all targets (it is url:line:column and not tied to a unique counter). So a breakpoint might resolve differently across multiple targets but have the same identifier.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1251530</commentid>
    <comment_count>3</comment_count>
      <attachid>294860</attachid>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2016-11-15 11:49:04 -0800</bug_when>
    <thetext>Created attachment 294860
[PATCH] Proposed Fix</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1251552</commentid>
    <comment_count>4</comment_count>
    <who name="Matt Baker">mattbaker</who>
    <bug_when>2016-11-15 12:13:11 -0800</bug_when>
    <thetext>Seems related to the change:

Regressions: Unexpected timeouts (1)
  inspector/worker/debugger-pause.html [ Timeout ]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1251555</commentid>
    <comment_count>5</comment_count>
    <who name="Matt Baker">mattbaker</who>
    <bug_when>2016-11-15 12:14:14 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; Seems related to the change:
&gt; 
&gt; Regressions: Unexpected timeouts (1)
&gt;   inspector/worker/debugger-pause.html [ Timeout ]

Actually it shouldn&apos;t, since this only changes what tree elements are added.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1251565</commentid>
    <comment_count>6</comment_count>
      <attachid>294860</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-11-15 12:35:48 -0800</bug_when>
    <thetext>Comment on attachment 294860
[PATCH] Proposed Fix

Clearing flags on attachment: 294860

Committed r208746: &lt;http://trac.webkit.org/changeset/208746&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1251566</commentid>
    <comment_count>7</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-11-15 12:35:52 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1251598</commentid>
    <comment_count>8</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2016-11-15 13:38:50 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; Seems related to the change:
&gt; &gt; 
&gt; &gt; Regressions: Unexpected timeouts (1)
&gt; &gt;   inspector/worker/debugger-pause.html [ Timeout ]
&gt; 
&gt; Actually it shouldn&apos;t, since this only changes what tree elements are added.

Addressing this in: bug 164787
&lt;https://webkit.org/b/164787&gt; Web Inspector: inspector/worker/debugger-pause.html fails on WebKit1</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>294860</attachid>
            <date>2016-11-15 11:49:04 -0800</date>
            <delta_ts>2016-11-15 12:35:48 -0800</delta_ts>
            <desc>[PATCH] Proposed Fix</desc>
            <filename>duplicates-1.patch</filename>
            <type>text/plain</type>
            <size>2499</size>
            <attacher name="Joseph Pecoraro">joepeck</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJJbnNwZWN0b3JVSS9DaGFuZ2VMb2cgYi9Tb3VyY2UvV2Vi
SW5zcGVjdG9yVUkvQ2hhbmdlTG9nCmluZGV4IDIyOWYyNWMuLmJmNjQ5YzIgMTAwNjQ0Ci0tLSBh
L1NvdXJjZS9XZWJJbnNwZWN0b3JVSS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYkluc3BlY3Rv
clVJL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE1IEBACisyMDE2LTExLTE1ICBKb3NlcGggUGVjb3Jh
cm8gIDxwZWNvcmFyb0BhcHBsZS5jb20+CisKKyAgICAgICAgV2ViIEluc3BlY3RvcjogVVJMIEJy
ZWFrcG9pbnRzIHRoYXQgcmVzb2x2ZSBpbiBtdWx0aXBsZSB3b3JrZXJzIHNob3VsZCBvbmx5IGFw
cGVhciBpbiB0aGUgVUkgb25jZQorICAgICAgICBodHRwczovL2J1Z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