Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 313241

Summary: [Help] page not found preference is ignored if any remote sites have errors
Product: [Eclipse Project] Platform Reporter: Chris Goldthorpe <cgold>
Component: User AssistanceAssignee: Chris Goldthorpe <cgold>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: ChrisAustin
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Patch none

Description Chris Goldthorpe CLA 2010-05-17 16:53:42 EDT
N20100516-2000

The preference org.eclipse.help.base/page_not_found is used when a user wants to return 404 instead of an error page when a page is not found, this allows link checking software to detect broken links. If RemoteStatusData.isAnyRemoteHelpUnavailable() returns true an error page will always be generated regardless of the setting of org.eclipse.help.base/page_not_found. I discovered this when running the UA link checker in a workspace that had a an invalid remote site.

Since this is a regression from Eclipse 3.5 I think it should be fixed for RC2.
Comment 1 Chris Goldthorpe CLA 2010-05-17 16:56:59 EDT
Created attachment 168823 [details]
Patch
Comment 2 Chris Goldthorpe CLA 2010-05-17 17:09:01 EDT
Steps to reproduce 

Use a recent Eclipse build - no newer than N20100516-2000
 (in case the JDT team fixes the broken link). 

1. Check out org.eclipse.ua.tests.doc into your workspace. 
2. Launch a new Eclipse
3. In the help menu there will be a submenu "Check Toc Links". Select it
4. A dialog is opened. Select Java Development User Guide and the radio button "Check files in TOC can load and check hyperlinks". Hit OK

In the console of the first Eclipse you should see this output:

Test level = 3 testing /org.eclipse.jdt.doc.user/toc.xml
Testing complete, errors found
Time out on page /org.eclipse.jdt.doc.user/tips/jdt_tips.html
Start checking 406 links
Cannot open link from /org.eclipse.jdt.doc.user/reference/ref-menu-navigate.htm to /org.eclipse.jdt.doc.user/reference/views/debug/ref-previousthread.htm
Cannot open link from /org.eclipse.jdt.doc.user/reference/ref-menu-navigate.htm to /org.eclipse.jdt.doc.user/reference/views/debug/ref-nextthread.htm
End check links

Note that if you see any timeout errors you will need to rerun this test, it sometimes loads the server to a point where a read does not respond quickly enough for the test.

Now in the Eclipse runtime workbench add a nonexistent remote help server and rerun the test. The link errors no longer showed up.
Comment 3 Chris Goldthorpe CLA 2010-05-17 17:10:50 EDT
Chris A, please review the patch and verify that after the patch the remote error page still shows in situations where it is expected to be displayed.
Comment 4 Chris Goldthorpe CLA 2010-05-17 20:09:17 EDT
Vivian, can you review this patch also - we need two reviewers for RC2.
Comment 5 Chris Austin CLA 2010-05-18 11:06:27 EDT
I could not quite make it through the repro steps to verify the problem (I did not see the category 'Java Development User Guide').  However, I tried to reproduce this outside of a list checker by setting the page_not_found preference to an empty String.  I saw the Network Help Unavailable page come up (if I had an unavailable server).  Otherwise its an empty page (404).

So this does seem like a problem, however we might consider deferring it until 3.7 because of its low impact.  I can't think of many scenarios (excluding list checkers) where a product would remove the default page not found to replace with an uglier 404 error code.

Also, the patch does not quite fix the problem - if page_not_found is left out of the preferences entirely, we should have the Network Unavailable page come up - that is by design.  The patch instead shows the topic not found page.
Comment 6 Chris Goldthorpe CLA 2010-05-18 12:52:46 EDT
After thinking about this some more I agree that this bug is not severe enough to warrant fixing in RC2. Deferring to Eclipse 3.7.
Comment 7 Chris Goldthorpe CLA 2010-10-14 17:59:04 EDT
I'm not so sure that it is important to fix this. Closing.