Skip to content
This repository has been archived by the owner on Sep 5, 2020. It is now read-only.

Mist browser doesn't redirect as expected #1560

Open
morelazers opened this issue Jan 6, 2017 · 7 comments
Open

Mist browser doesn't redirect as expected #1560

morelazers opened this issue Jan 6, 2017 · 7 comments

Comments

@morelazers
Copy link

First off - love the app, awesome work.

OSX Sierra
Mist 0.8.8

I'm using expressjs to build a dapp, and at certain points in the application, I'm using JavaScript to submit POST forms.

Within the request handler, there is code which redirects the browser back to the same page the POST request came from, but Mist isn't 'reloading' the page as it should.

I know this might be bad form, but on every other browser (that I've tried) it's not an issue, so if it's a design decision is there a reason specified?

I've tested by changing the URL that it's redirecting to, and it works great, issue only occurs when I'm trying to redirect to the same place.

Thanks!

@frozeman
Copy link
Contributor

frozeman commented Feb 6, 2017

Hm that might be a special case where our routing doenstn properly work.
If you can give me a simple repro index.html i will try to fix it.

@morelazers
Copy link
Author

morelazers commented Feb 6, 2017

Thanks @frozeman, I'm actually struggling to reproduce. It's odd in that the request is going through, but the response comes back as 'canceled' in the dev tools.
image
I can confirm it's working in Chrome, are there any additional steps you think I should take to narrow down the problem?

Edit: Managed to reproduce, source code here: https://github.com/morelazers/mist-redirect

@frozeman
Copy link
Contributor

frozeman commented Feb 6, 2017

We handle the redirection in mist customised, so io would need a simple repo to be able to play around with it.

@morelazers
Copy link
Author

@frozeman Yeah sorry - the source code is in the repo linked above - it should provide the same behaviour

https://github.com/morelazers/mist-redirect

@luclu
Copy link
Contributor

luclu commented Mar 14, 2017

I might be missing something here, but the test repo seems to work for me using Mist 0.8.9, Firefox and Chromium.

Here is a quick gif (5mb) of what happens in Mist:

kapture 2017-03-14 at 19 07 18

@morelazers
Copy link
Author

Hi @luclu, thanks for taking a look. My example wasn't clear enough, apologies. I've pushed an extra line or two to the repo which should make it clearer.

@luclu
Copy link
Contributor

luclu commented Mar 14, 2017

Thank you @morelazers, the change makes it clear. (Mist vs. Chromium):

kapture 2017-03-14 at 22 04 54

@frozeman for your convenience: ;-)

<form method="POST" action="/">
    <input type="submit"  value="Submit">
</form>

<div id="message"></div>

<script>
    $('form').on('submit', function() {
    $("#message").text('This should disappear')
	$(this).unbind('submit').submit();
    })
</script>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants