spatelsofmen / phpdesktop

Automatically exported from code.google.com/p/phpdesktop
0 stars 0 forks source link

Issues with Back/Forward/Reload on POST requests #138

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
During testing of POST requests for pretty urls, a new bug was found. When 
doing a post request to a non-pretty url, and later navigation Back and Forward 
in history using mouse context menu, an error occurs:

  Loading error (-400).

The message above is outputted in `ClientHandler::OnLoadError()`.

Original issue reported on code.google.com by czarek.t...@gmail.com on 28 Oct 2014 at 9:43

GoogleCodeExporter commented 9 years ago
The meaning of -400 error in Chromium:

  // The cache does not have the requested entry.
  NET_ERROR(CACHE_MISS, -400)

There seem to be two solutions
a) Find a way to resent the POST request
b) Handle -400 error by navigating Back in history. Unfortunately it makes any 
Forward navigation not possible if there was a POST request made at some point.

Original comment by czarek.t...@gmail.com on 28 Oct 2014 at 10:00

GoogleCodeExporter commented 9 years ago
Solution b) does not work. The steps are:
1. GET index.php
2. GET pretty-urls.php
3. POST pretty-urls.php
4. Back() to GET pretty-urls.php
5. Forward() to POST pretty-urls.php - this Back() in OnLoadError and causes a 
redirect to 1) GET index.php

Step 5) should cause stepping back to step 2) to GET pretty-urls.php. Maybe it 
should be browser->Reload() called in step 5 instead of Back()?

Original comment by czarek.t...@gmail.com on 28 Oct 2014 at 10:15

GoogleCodeExporter commented 9 years ago
By doing Reload() in step 5) it is step 3) POST that is repeated. And step 2) 
completely disappears from navigation history. Going Back() after step 5) takes 
back to step 1) GET index.php. Now, doing a Forward makes it to step 3). Step 
2) is lost.

Original comment by czarek.t...@gmail.com on 28 Oct 2014 at 10:21

GoogleCodeExporter commented 9 years ago
Issue reported on CEF Forum:
http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=12238

Original comment by czarek.t...@gmail.com on 28 Oct 2014 at 10:45

GoogleCodeExporter commented 9 years ago
Partially fixed in revision 5a4ac254cc18. There are still problems as some of 
the entries in navigation history are lost. It gets rid of the "-400 Loading 
error" being displayed to user. And POST request is resent properly when 
navigating in history.

Original comment by czarek.t...@gmail.com on 28 Oct 2014 at 10:56

GoogleCodeExporter commented 9 years ago
Issue `1420` created in CEF tracker:
https://code.google.com/p/chromiumembedded/issues/detail?id=1420

Original comment by czarek.t...@gmail.com on 28 Oct 2014 at 2:18

GoogleCodeExporter commented 9 years ago

Original comment by czarek.t...@gmail.com on 29 Oct 2014 at 9:30