Search Unity

Unity WEBGL Build locking browser on redirect (Ruby/Rails on Heroku)

Discussion in 'Editor & General Support' started by meta_monkey, Nov 13, 2018.

  1. meta_monkey

    meta_monkey

    Joined:
    Feb 22, 2018
    Posts:
    6
    I just upgraded to plus so I could get the additional support. First question, was that worth it?

    Now for the actual problem:

    I have a unity generated WEBGL player embedded in a rails static page as 'demo_path' like so:

    __________________________________________________________________
    <% provide(:title, 'Sign up') %>
    <h1>Sign up</h1>
    <div class="row">
    <div class="col-md-6 col-md-offset-3">
    <%= form_for([USER=5806]@User[/USER], url: signup_path) do |f| %>
    <%= render 'shared/error_messages' %>
    <%= link_to "mindpass", demo_path, class: "btn btn-lg btn-primary"
    %>
    <%= f.submit "Create my account", class: "btn btn-primary" %>
    <% end %>
    </div>
    </div>

    __________________________________________________________________

    When the user clicks the button, it loads the webgl template:
    __________________________________________________________________
    <!DOCTYPE html>
    <html lang="en-us">
    <head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-
    8">
    <title>Unity WebGL Player | MindPass_DEMO</title>
    <script src="Build/UnityLoader.js"></script>
    <script>
    var gameInstance = UnityLoader.instantiate("gameContainer",
    "/assets/Build/MindPass_WEBGL_RY2.json");
    </script>
    </head>
    <body>
    <div id="gameContainer" style="width: 90%; height: 90%; position:
    absolute; margin: auto;"></div>
    </body>
    </html>

    __________________________________________________________________

    This loads successfully and actually initiates the users controller to save a new user and initiates the 'redirect_to @users' as shown in the following users_controller code:
    __________________________________________________________________
    def create
    puts "create runs"
    #puts params.inspect
    [USER=5806]@User[/USER] = User.new(user_params)
    if @user.save

    puts "user save runs"
    log_in [USER=5806]@User[/USER]
    puts "second welcome to your vault(users_cont)"
    flash[:success] = "Welcome to your vault!"
    redirect_to [USER=5806]@User[/USER]
    else
    puts "render new runs"
    render 'new'
    end
    end

    __________________________________________________________________

    The problem is that the redirect doesn't actually happen. The WEBGL build just sits there running and locks the page up. Here is the log from the attempt, including the redirect:

    __________________________________________________________________
    2018-11-07T05:04:21.897020+00:00 app[web.1]: I,

    [2018-11-07T05:04:21.896891 [URL='https://support.unity3d.com/hc/requests/20']#20[/URL]] INFO -- : [c5de6e8e-58e2-4177-ae17-e1f58fbb65ee] Started POST "/signup" for 76.120.71.73 at 2018-11-07 05:04:21 +0000 2018-11-07T05:04:21.898131+00:00 app[web.1]: I,

    [2018-11-07T05:04:21.898049 [URL='https://support.unity3d.com/hc/requests/20']#20[/URL]] INFO -- : [c5de6e8e-58e2-4177-ae17-e1f58fbb65ee] Processing by UsersController#create as / 2018-11-07T05:04:21.901161+00:00 app[web.1]: I, [2018-11-07T05:04:21.901036 [URL='https://support.unity3d.com/hc/requests/20']#20[/URL]] INFO -- : [c5de6e8e-58e2-4177-ae17-e1f58fbb65ee] Parameters: {"EMAIL"=>"[EMAIL]jakeywtf34@gmail.com[/EMAIL]", "PASSWORD"=>"[FILTERED]"}

    2018-11-07T05:04:21.902007+00:00 app[web.1]: W, [2018-11-07T05:04:21.901922 [URL='https://support.unity3d.com/hc/requests/20']#20[/URL]] WARN -- : [c5de6e8e-58e2-4177-ae17-e1f58fbb65ee] Can't verify CSRF token authenticity. 2018-11-07T05:04:21.907902+00:00 app[web.1]: create runs

    2018-11-07T05:04:21.907965+00:00 app[web.1]: user_params runs

    2018-11-07T05:04:21.908031+00:00 app[web.1]: unless state in user_params 2018-11-07T05:04:22.141541+00:00 app[web.1]: D,

    [2018-11-07T05:04:22.141393 [URL='https://support.unity3d.com/hc/requests/20']#20[/URL]] DEBUG -- : [c5de6e8e-58e2-4177-ae17-e1f58fbb65ee] [1m[35m (5.0ms)[0m [1m[35mBEGIN[0m 2018-11-07T05:04:22.145580+00:00 app[web.1]: D, [2018-11-07T05:04:22.145463 [URL='https://support.unity3d.com/hc/requests/20']#20[/URL]] DEBUG -- : [c5de6e8e-58e2-4177-ae17-e1f58fbb65ee] [1m[36mUser Exists (2.5ms)[0m [1m[34mSELECT 1 AS one FROM "users" WHERE LOWER("users"."email") = LOWER($1) LIMIT $2[0m [["email", "[EMAIL]jakeywtf34@gmail.com[/EMAIL]"], ["LIMIT", 1]]

    2018-11-07T05:04:22.149368+00:00 app[web.1]: D,

    [2018-11-07T05:04:22.149270 [URL='https://support.unity3d.com/hc/requests/20']#20[/URL]] DEBUG -- : [c5de6e8e-58e2-4177-ae17-e1f58fbb65ee] [1m[35mSQL (2.1ms)[0m [1m[32mINSERT INTO "users" ("email", "created_at", "updated_at", "password_digest") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["email", "[EMAIL]jakeywtf34@gmail.com[/EMAIL]"], ["created_at", "2018-11-07 05:04:22.146010"], ["updated_at", "2018-11-07 05:04:22.146010"], ["password_digest", "$2a$10$g.RhGJDfl23/zPDeyXEI.OcnsfKfYH3jE4GB7py6/ktMJ3N6y73OW"]]

    2018-11-07T05:04:22.153387+00:00 app[web.1]: D,

    [2018-11-07T05:04:22.153287 [URL='https://support.unity3d.com/hc/requests/20']#20[/URL]] DEBUG -- : [c5de6e8e-58e2-4177-ae17-e1f58fbb65ee] [1m[35m (3.5ms)[0m [1m[35mCOMMIT[0m 2018-11-07T05:04:22.153528+00:00 app[web.1]: user save runs 2018-11-07T05:04:22.153618+00:00 app[web.1]: second welcome to your vault(users_cont) 2018-11-07T05:04:22.154318+00:00 app[web.1]: I,

    [2018-11-07T05:04:22.154239 [URL='https://support.unity3d.com/hc/requests/20']#20[/URL]] INFO -- : [c5de6e8e-58e2-4177-ae17-e1f58fbb65ee] Redirected to [URL]https://immense-castle-53592.herokuapp.com/users/126[/URL]

    2018-11-07T05:04:22.154585+00:00 app[web.1]: I,

    [2018-11-07T05:04:22.154507 [URL='https://support.unity3d.com/hc/requests/20']#20[/URL]] INFO -- : [c5de6e8e-58e2-4177-ae17-e1f58fbb65ee] Completed 302 Found in 253ms (ActiveRecord: 13.0ms) 2018-11-07T05:04:22.221827+00:00 app[web.1]: I,

    [2018-11-07T05:04:22.221705 [URL='https://support.unity3d.com/hc/requests/6']#6[/URL]] INFO -- : [972376e5-2f11-4985-91fe-53b071181359] Started GET "/users/126" for 76.120.71.73 at 2018-11-07 05:04:22 +0000 2018-11-07T05:04:22.229274+00:00 app[web.1]: I,

    [2018-11-07T05:04:22.229112 [URL='https://support.unity3d.com/hc/requests/6']#6[/URL]] INFO -- : [972376e5-2f11-4985-91fe-53b071181359] Processing by UsersController#show as / 2018-11-07T05:04:22.230258+00:00 app[web.1]: I,

    [2018-11-07T05:04:22.230174 [URL='https://support.unity3d.com/hc/requests/6']#6[/URL]] INFO -- : [972376e5-2f11-4985-91fe-53b071181359] Parameters: {"id"=>"126"}

    2018-11-07T05:04:22.156370+00:00 heroku[router]: at=info method=POST path="/signup" host=[URL='http://immense-castle-53592.herokuapp.com/']immense-castle-53592.herokuapp.com[/URL] request_id=c5de6e8e-58e2-4177-ae17-e1f58fbb65ee fwd="76.120.71.73" dyno=web.1 connect=1ms service=264ms status=302 bytes=559 protocol=https 2018-11-07T05:04:22.419460+00:00 app[web.1]: D,

    [2018-11-07T05:04:22.419270 [URL='https://support.unity3d.com/hc/requests/6']#6[/URL]] DEBUG -- : [972376e5-2f11-4985-91fe-53b071181359] [1m[36mUser Load (6.4ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2[0m [["id", 126], ["LIMIT", 1]]

    2018-11-07T05:04:22.469417+00:00 app[web.1]: I,

    [2018-11-07T05:04:22.469246 [URL='https://support.unity3d.com/hc/requests/6']#6[/URL]] INFO -- : [972376e5-2f11-4985-91fe-53b071181359] Rendering users/show.html.erb within layouts/application 2018-11-07T05:04:22.470569+00:00 app[web.1]: I,

    [2018-11-07T05:04:22.470487 [URL='https://support.unity3d.com/hc/requests/6']#6[/URL]] INFO -- : [972376e5-2f11-4985-91fe-53b071181359] Rendered users/show.html.erb within layouts/application (1.0ms) 2018-11-07T05:04:22.484847+00:00 app[web.1]: I,

    [2018-11-07T05:04:22.484727 [URL='https://support.unity3d.com/hc/requests/6']#6[/URL]] INFO -- : [972376e5-2f11-4985-91fe-53b071181359] Rendered layouts/_rails_default.html.erb (4.8ms)

    2018-11-07T05:04:22.497488+00:00 app[web.1]: I,

    [2018-11-07T05:04:22.497361 [URL='https://support.unity3d.com/hc/requests/6']#6[/URL]] INFO -- : [972376e5-2f11-4985-91fe-53b071181359] Rendered layouts/_shim.html.erb (0.5ms) 2018-11-07T05:04:22.526778+00:00 app[web.1]: I,

    [2018-11-07T05:04:22.526644 [URL='https://support.unity3d.com/hc/requests/6']#6[/URL]] INFO -- : [972376e5-2f11-4985-91fe-53b071181359] Rendered layouts/_header.html.erb (12.1ms) 2018-11-07T05:04:22.540219+00:00 app[web.1]: I,

    [2018-11-07T05:04:22.540092 [URL='https://support.unity3d.com/hc/requests/6']#6[/URL]] INFO -- : [972376e5-2f11-4985-91fe-53b071181359] Rendered layouts/_footer.html.erb (1.0ms) 2018-11-07T05:04:22.541427+00:00 app[web.1]: I,

    [2018-11-07T05:04:22.541342 [URL='https://support.unity3d.com/hc/requests/6']#6[/URL]] INFO -- : [972376e5-2f11-4985-91fe-53b071181359] Completed 200 OK in 311ms (Views: 83.8ms | ActiveRecord: 103.3ms)

    2018-11-07T05:04:22.544712+00:00 heroku[router]: at=info method=GET path="/users/126" host=[URL='http://immense-castle-53592.herokuapp.com/']immense-castle-53592.herokuapp.com[/URL] request_id=972376e5-2f11-4985-91fe-53b071181359 fwd="76.120.71.73" dyno=web.1 connect=1ms service=324ms status=200 bytes=2692 protocol=https


    __________________________________________________________________

    When I do this with normal form inputs like below, the same redirect log happens, and it actually goes to the users page.:
    __________________________________________________________________
    <%= f.label :email %>
    <%= f.email_field :email, class: 'form-control' %>

    <%= f.label :password %>
    <%= f.password_field :password, class: 'form-control' %>


    __________________________________________________________________

    It seems as if WEBGL is locking this thing up and refusing the page to actually redirect, even though it should be happening. What am I missing?
     
  2. Well, why don't you try to find out and head to the support then? I don't really understand.
     
  3. meta_monkey

    meta_monkey

    Joined:
    Feb 22, 2018
    Posts:
    6
    I already contacted support. I was curious about the opinions of other users.
     
    Lurking-Ninja likes this.
  4. Ok, I probably misunderstood then, my impression was that you expect support here.
     
  5. meta_monkey

    meta_monkey

    Joined:
    Feb 22, 2018
    Posts:
    6
    Not expected, just appreciated.