-
Notifications
You must be signed in to change notification settings - Fork 213
Description
In our IHP 1.3 project there's a Controller that uses autoRefresh to render a view until a particular field in the database changes. When that field changes it sends a redirectTo. This worked well for showing a spinner animation while waiting for something to happen, then redirecting the user after.
In IHP 1.4 (I also tried updating our project to the latest commit, too) this is no longer working. I have created an example IHP project so the issue is reproducible.
To reproduce:
- Start the IHP project and open it in a browser, as usual.
- Create a new Foo using the + New button.
- Click the Show link.
- In a second tab, open up the IHP IDE (if it isn't open already)
- Go to Data →
foosand click thebartickbox, so it's set toTrue
What I expect to happen: the user is sent to /Welcome.
What actually happens: the screen is white, and on the network tab of Developer Tools I see two empty responses from the websocket.
Note: clicking refresh in the browser makes IHP send the redirect correctly, so I surmise the issue is with autoRefresh.
Here're the problematic lines of code in context. For brevity:
action ShowFooAction { fooId } = autoRefresh do
foo <- fetch fooId
if not foo.bar
then render ShowView { .. }
else redirectTo WelcomeAction