Bug 269702

Summary: URL bar does not change when clicking back
Product: [Applications] rekonq Reporter: Jonathan Riddell <jr>
Component: generalAssignee: Andrea Diamantini <adjam7>
Status: RESOLVED UPSTREAM    
Severity: major CC: cubranic, fxrh, rohan
Priority: NOR    
Version: latest git snapshot   
Target Milestone: 0.8   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: working testcase

Description Jonathan Riddell 2011-03-29 16:08:09 UTC
Version:           latest git snapshot (using KDE 4.6.1) 
OS:                Linux

On some websites when I click back the address in the URL bar does not change.  Clicking back again changes it to an off by one address. 

Reproducible: Always

Steps to Reproduce:
Go to http://cdimage.ubuntu.com/ click kubuntu then daily
click back
click back again

Actual Results:  
On the first back, the URL bar remains at /kubuntu/daily/
On the second back, the URL bar remains at /kubuntu/

Expected Results:  
On the first back, the URL bar should be /kubuntu/
On the second back, the URL bar should be /
Comment 1 Rohan Garg 2011-03-29 16:28:12 UTC
Confirmed, targeting to 0.7
Comment 2 Andrea Diamantini 2011-03-29 18:25:10 UTC
Sorry, this does not happen here.
Comment 3 Felix Rohrbach 2011-04-02 15:59:20 UTC
This may be connected to bug 260844. I can confirm this on rekonq and arora, so I guess this is an upstream bug.
Comment 4 Felix Rohrbach 2011-04-02 18:05:23 UTC
Created attachment 58521 [details]
working testcase

I did some investigations on that bug.

When I click the back button, MainWindow::openPrevious is called. Here, a QWebHistoryItem is created, which has the right url. With this item, QWebHistory::goToItem is called.

When MainView::webViewUrlChanged(const QUrl&) is called by the QWebView::urlChanged signal, the url has changed to the wrong one (e.g. before "http://cdimage.ubuntu.com/kubuntu/", now "http://cdimage.ubuntu.com/kubuntu/daily/").

I could not reproduce this with a similar testcase (attached), so somewhere that url was changed or my testcase is different from this situation.

My system:
KDE 4.6.1
Qt 4.7.2
GCC 4.5.2
Arch Linux 64bit
Comment 5 Davor Cubranic 2011-06-14 20:18:06 UTC
I can reproduce this with rekonq 0.7.0 (Kubuntu Natty) while working through the Rails "getting started" guide (http://guides.rubyonrails.org/getting_started.html). Halfway through section 4.3 of the guide, I go through the following set of URLs:

1. localhost:3000 (Error: no route matches "/")
2. localhost:3000/home (Error: no route matches "/home")
3. localhost:3000/home/index (valid page is rendered)

When I go back from the third step (either with alt-left or by clicking on the back button in the toolbar), the page is rerendered, but the location bar lags by one step. (I.e., when I go back from step 3. to 2., it's still showing "localhost:3000/home/index", and when I go back to step 1., it shows "localhost:3000/home".)
Comment 6 Davor Cubranic 2011-06-14 20:44:19 UTC
In my test case, the key is that a page returns an error (404 for step 1 and 2). This is confirmed by the fact that when I add a route so that "localhost:3000" matches a valid page, only going back from step 3 to 2 fails to update the location bar, because that page is still a 404. Going back to step 1 is now a valid page (200), and the location is updated correctly.
Comment 7 Andrea Diamantini 2011-09-10 16:51:40 UTC
Targetting 0.8, but I really never could reproduce it. Can you test it again, please?
Comment 8 Felix Rohrbach 2011-09-10 16:56:43 UTC
I'm still able to reproduce it.
Comment 9 Andrea Diamantini 2011-09-11 09:47:59 UTC
Ah.. found the culprit! I can reproduce it against QtWebkit 2.0.x but NOT against QtWebKit 2.2.
Targetting as RESOLVED -> UPSTREAM.