This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 140442 - debugger does not handle URLs with query strings correctly
Summary: debugger does not handle URLs with query strings correctly
Status: VERIFIED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: _ deva
URL:
Keywords: UI
Depends on:
Blocks:
 
Reported: 2008-07-17 04:22 UTC by richo
Modified: 2008-09-29 23:43 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Ruby on Rails project to demonstrate the issue (45.58 KB, application/x-compressed)
2008-08-01 07:32 UTC, richo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description richo 2008-07-17 04:22:26 UTC
If Js files are included in a HTML file with parameters breakpoints won't work.

e.g.

This does not work:
  <script src="/javascripts/application.js?1216255909" type="text/javascript"></script>

This does work:
  <script src="/javascripts/application.js" type="text/javascript"></script>

Ruby on Rails appends a time stamp to includes to prevent caching issues.
Comment 1 _ deva 2008-07-29 03:01:33 UTC
Could you please attach a sample project or steps to reproduce this issue. 
Comment 2 richo 2008-08-01 07:32:02 UTC
Created attachment 66251 [details]
Ruby on Rails project to demonstrate the issue
Comment 3 richo 2008-08-01 07:36:34 UTC
Open the attached project in Netbeans (must have Ruby support). I'm using netbeans-hudson-trunk-3092-ruby.zip.

The project uses MySQL, if you have that run the rake task db:create (Alt+Shift+R) to generate the database (it is not
used, but rails requires it). If you don't have MySQL installed then change /config/database.yml to suit.

Run the project in the debugger (clientside should be enabled). Set a breakpoint in the /script/application.js file.

The web pages server from this project contains more information and instructions.
Comment 4 _ sandipchitale 2008-08-08 21:25:27 UTC
This behavior of appending a query string to resource URLs occurs due to the use of RAILS_ASSET_ID variable. Have you
tried to set it to "" (empty string) or unsetting it and see if it works better for you. Will that be an acceptable
workaround (i.e. asking the user to set it to "" only during debug mode?).

Currently the algorithm that matches the URL to a file in the project does an exact match of the resource name. As a
general case the presence of a query string is assumed to indicate a dynamically generated resource and thus potentially
not matching with the file content (e.g. line number may not match - which is basically how the line breakpoints are
annotated and matched).

BTW there is a workaround. Once the debugging sessions starts, go to the Sources window, select the entry that
corresponds to the resource in question. If the entry looks like an URL simply double click it to open in an editor and
then set the breakpoint in that editor. 

Prior to some recent fix - (changeset http://hg.netbeans.org/main/rev/fdee9f28e9c3 ) - such resource (with query
strings) URLs were incorrectly mapped to the file path. In such cases the entry shows file path. In that case you can
use the Goto Client Source action in the entries pop up menu to open the client side source of the resource and then set
a breakpoint in it.

As there is a workaround reducing the priority to P3.
Comment 5 richo 2008-09-02 23:37:33 UTC
Disabling the query strings is not an acceptable workaround for me. The query strings are used to prevent caching, which
is important in development.
Comment 6 Quy Nguyen 2008-09-02 23:50:29 UTC
We may be able to provide a fix for this case (query string on .js files) and for other specific cases (query string
used by xdebug for php), but in general the differences in query strings may indicate that the source files are different.
Comment 7 richo 2008-09-03 00:10:26 UTC
In the context of a Ruby on Rails application it is highly unlikely that the query string will mean different files. 
Maybe it needs to be a Project option, with the option defaulted to "ignore query strings" in Ruby on Rails 
applications.
Comment 8 Martin Krauskopf 2008-09-04 09:50:57 UTC
Sandip is not going to fix this issue, I think. Can somebody else take over?
Comment 9 Martin Krauskopf 2008-09-04 09:54:22 UTC
Sandip (might be somebody else from debuggerjavascript team), could you reassign your issue to somebody else. I'm not
sure whether you will contribute to this plugin, but there are few outstanding issue which might influence areas like
PHP debugger, Ruby debugger, etc. So we are sure they are handled appropriately. Thanks.
Comment 10 Quy Nguyen 2008-09-12 02:52:16 UTC
Looking into providing an option to ignore query strings.
Comment 11 Quy Nguyen 2008-09-19 01:17:19 UTC
This has been done for Firefox (not yet checked in).  Passing to deva for required changes in IE extension.
Comment 12 Quality Engineering 2008-09-20 17:18:04 UTC
Integrated into 'main-golden', will be available in build *200809201401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/86f5dc80b3e5
User: Quy Nguyen <quynguyen@netbeans.org>
Log: #140442 - IDE modifications to support ignoring of query strings in JS debugger
Comment 13 Quality Engineering 2008-09-21 05:11:21 UTC
Integrated into 'main-golden', will be available in build *200809210201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/a08695ce5d9e
User: deva@netbeans.org
Log: #140442 - Additional changes for IE Add-on
Comment 14 _ krystyna 2008-09-22 21:38:41 UTC
Checked in. Marking fixed.
Comment 15 Quy Nguyen 2008-09-22 21:40:14 UTC
I'm not 100% sure that all the Internet Explorer fixes have been done, though.
Comment 16 _ krystyna 2008-09-23 03:37:24 UTC
Cannot test this: see #147949
Comment 17 _ krystyna 2008-09-29 23:39:10 UTC
Tested with IE on NetBeans IDE Dev (Build 20080929142249)
Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b13
System: Windows XP version 5.1
Comment 18 _ krystyna 2008-09-29 23:43:33 UTC
Verified in NetBeans IDE Dev (Build 20080929142249)
Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b13
System: Windows XP version 5.1