hotwired / hotwire-native-ios

Hotwire Native for iOS
MIT License
70 stars 7 forks source link

webviews within hotwire native app seem to break after upgrading kamal-proxy #44

Closed 34code closed 5 hours ago

34code commented 2 days ago

upgraded to latest kamal proxy and get the following screen on all links now when pointed to "remote". Localhost seems to work fine inside simulator.

Same issue when simulator is pointed to "remote". Here are some logs..

Screenshot 2024-11-09 at 9 59 45 PM Screenshot 2024-11-09 at 10 00 59 PM

34code commented 2 days ago

some additional logs

Screenshot 2024-11-09 at 10 12 24 PM

joemasilotti commented 2 days ago

What version of iOS are you running?

What do your sever logs report?

34code commented 2 days ago

I'm running iOS 18 in the simulator and 18.2 beta on device. Looking at server logs in production now..

34code commented 2 days ago

Production logs when loading the app from simulator show the following:

[5031df65-0bca-4078-a760-2307521259e7] Processing by MobileController#home as HTML
[5031df65-0bca-4078-a760-2307521259e7]   Rendered layout app/views_mobile/layouts/mobile.html.erb (Duration: 1.0ms | GC: 0.0ms)
[5031df65-0bca-4078-a760-2307521259e7] Completed 200 OK in 395ms (Views: 1.4ms | ActiveRecord: 391.2ms (3 queries, 0 cached) | GC: 0.0ms)
[defcc7a0-0257-4994-8371-f89b2626c855] Started GET "/fp?fp=1542811075&b=WebKit&d=iPhone&o=iOS&sr=402x874&c=undefined&ua=Mozilla/5.0%20(iPhone;%20CPU%20iPhone%20OS%2018_0%20like%20Mac%20OS%20X)%20AppleWebKit/605.1.15%20(KHTML,%20like%20Gecko)%20Hotwire%20Native%20iOS;%20Turbo%20Native%20iOS%20bridge-components:%20[form%20menu%20overflow-menu]" for 172.71.154.230 at 2024-11-10 20:10:31 +0000
[defcc7a0-0257-4994-8371-f89b2626c855] Processing by ApplicationController#grab_fingerprint as */*
[defcc7a0-0257-4994-8371-f89b2626c855]   Parameters: {"fp"=>"1542811075", "b"=>"WebKit", "d"=>"iPhone", "o"=>"iOS", "sr"=>"402x874", "c"=>"undefined", "ua"=>"Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Hotwire Native iOS; Turbo Native iOS bridge-components: [form menu overflow-menu]"}
[3a869765-39a5-4435-a7dd-9a3215ed938b] Started GET "/fp?fp=1542811075&b=WebKit&d=iPhone&o=iOS&sr=402x874&c=undefined&ua=Mozilla/5.0%20(iPhone;%20CPU%20iPhone%20OS%2018_0%20like%20Mac%20OS%20X)%20AppleWebKit/605.1.15%20(KHTML,%20like%20Gecko)%20Hotwire%20Native%20iOS;%20Turbo%20Native%20iOS%20bridge-components:%20[form%20menu%20overflow-menu]" for 172.71.154.231 at 2024-11-10 20:10:31 +0000
[3a869765-39a5-4435-a7dd-9a3215ed938b] Processing by ApplicationController#grab_fingerprint as */*
[3a869765-39a5-4435-a7dd-9a3215ed938b]   Parameters: {"fp"=>"1542811075", "b"=>"WebKit", "d"=>"iPhone", "o"=>"iOS", "sr"=>"402x874", "c"=>"undefined", "ua"=>"Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Hotwire Native iOS; Turbo Native iOS bridge-components: [form menu overflow-menu]"}
[16e415f7-126c-427b-b3cc-1d1574086b66] Started GET "/fp?fp=1542811075&b=WebKit&d=iPhone&o=iOS&sr=402x874&c=undefined&ua=Mozilla/5.0%20(iPhone;%20CPU%20iPhone%20OS%2018_0%20like%20Mac%20OS%20X)%20AppleWebKit/605.1.15%20(KHTML,%20like%20Gecko)%20Hotwire%20Native%20iOS;%20Turbo%20Native%20iOS%20bridge-components:%20[form%20menu%20overflow-menu]" for 172.71.154.231 at 2024-11-10 20:10:31 +0000
[16e415f7-126c-427b-b3cc-1d1574086b66] Processing by ApplicationController#grab_fingerprint as */*
[16e415f7-126c-427b-b3cc-1d1574086b66]   Parameters: {"fp"=>"1542811075", "b"=>"WebKit", "d"=>"iPhone", "o"=>"iOS", "sr"=>"402x874", "c"=>"undefined", "ua"=>"Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Hotwire Native iOS; Turbo Native iOS bridge-components: [form menu overflow-menu]"}
[3a869765-39a5-4435-a7dd-9a3215ed938b] Completed 200 OK in 35ms (Views: 0.3ms | ActiveRecord: 31.1ms (2 queries, 0 cached) | GC: 0.0ms)
[defcc7a0-0257-4994-8371-f89b2626c855] Completed 200 OK in 41ms (Views: 0.2ms | ActiveRecord: 38.2ms (2 queries, 0 cached) | GC: 0.0ms)
[16e415f7-126c-427b-b3cc-1d1574086b66] Completed 200 OK in 42ms (Views: 0.1ms | ActiveRecord: 40.7ms (2 queries, 0 cached) | GC: 0.0ms)
[95613662-c2c5-4e36-9a29-ab1181f60d46] Started GET "/fp?fp=1542811075&b=WebKit&d=iPhone&o=iOS&sr=402x874&c=undefined&ua=Mozilla/5.0%20(iPhone;%20CPU%20iPhone%20OS%2018_0%20like%20Mac%20OS%20X)%20AppleWebKit/605.1.15%20(KHTML,%20like%20Gecko)%20Hotwire%20Native%20iOS;%20Turbo%20Native%20iOS%20bridge-components:%20[form%20menu%20overflow-menu]" for 172.71.154.231 at 2024-11-10 20:10:31 +0000
[95613662-c2c5-4e36-9a29-ab1181f60d46] Processing by ApplicationController#grab_fingerprint as */*
[95613662-c2c5-4e36-9a29-ab1181f60d46]   Parameters: {"fp"=>"1542811075", "b"=>"WebKit", "d"=>"iPhone", "o"=>"iOS", "sr"=>"402x874", "c"=>"undefined", "ua"=>"Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Hotwire Native iOS; Turbo Native iOS bridge-components: [form menu overflow-menu]"}
[95613662-c2c5-4e36-9a29-ab1181f60d46] Completed 200 OK in 16ms (Views: 0.4ms | ActiveRecord: 14.2ms (2 queries, 0 cached) | GC: 0.0ms)
[d8bc6946-1c1e-45a5-85ee-daf354f54767] Started GET "/m" for 172.71.154.231 at 2024-11-10 20:11:16 +0000
[d8bc6946-1c1e-45a5-85ee-daf354f54767] Processing by MobileController#home as HTML
[d8bc6946-1c1e-45a5-85ee-daf354f54767]   Rendered layout app/views_mobile/layouts/mobile.html.erb (Duration: 0.7ms | GC: 0.0ms)
[d8bc6946-1c1e-45a5-85ee-daf354f54767] Completed 200 OK in 385ms (Views: 1.0ms | ActiveRecord: 382.3ms (2 queries, 0 cached) | GC: 0.0ms)
[f2cf3b22-fbe5-4734-9f1f-f871ccea6495] Started GET "/fp?fp=1542811075&b=WebKit&d=iPhone&o=iOS&sr=402x874&c=undefined&ua=Mozilla/5.0%20(iPhone;%20CPU%20iPhone%20OS%2018_0%20like%20Mac%20OS%20X)%20AppleWebKit/605.1.15%20(KHTML,%20like%20Gecko)%20Hotwire%20Native%20iOS;%20Turbo%20Native%20iOS%20bridge-components:%20[form%20menu%20overflow-menu]" for 172.71.154.230 at 2024-11-10 20:11:17 +0000
[f2cf3b22-fbe5-4734-9f1f-f871ccea6495] Processing by ApplicationController#grab_fingerprint as */*
[f2cf3b22-fbe5-4734-9f1f-f871ccea6495]   Parameters: {"fp"=>"1542811075", "b"=>"WebKit", "d"=>"iPhone", "o"=>"iOS", "sr"=>"402x874", "c"=>"undefined", "ua"=>"Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Hotwire Native iOS; Turbo Native iOS bridge-components: [form menu overflow-menu]"}
[f2cf3b22-fbe5-4734-9f1f-f871ccea6495] Completed 200 OK in 32ms (Views: 0.3ms | ActiveRecord: 30.0ms (2 queries, 0 cached) | GC: 0.0ms)

I have a GET /fp which is fired by JS on page load to detect browser fingerprints of users for tackling fraud and bot activity..

34code commented 2 days ago

Should I show the kamal-proxy logs as well?

34code commented 2 days ago

here is some log output from the kamal-proxy container...


{"time":"2024-11-10T20:10:31.389230342Z","level":"INFO","msg":"Request","host":"botflip.com","port":80,"path":"/fp","request_id":"defcc7a0-0257-4994-8371-f89b2626c855","status":200,"service":"botflip-web","target":"758358dbac20:3000","duration":44442958,"method":"GET","req_content_length":0,"req_content_type":"","resp_content_length":7,"resp_content_type":"text/html; charset=utf-8","client_addr":"172.71.154.230","client_port":"16180","remote_addr":"67.180.1.189","user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Hotwire Native iOS; Turbo Native iOS bridge-components: [form menu overflow-menu]","proto":"HTTP/1.1","scheme":"http","query":"fp=1542811075&b=WebKit&d=iPhone&o=iOS&sr=402x874&c=undefined&ua=Mozilla/5.0%20(iPhone;%20CPU%20iPhone%20OS%2018_0%20like%20Mac%20OS%20X)%20AppleWebKit/605.1.15%20(KHTML,%20like%20Gecko)%20Hotwire%20Native%20iOS;%20Turbo%20Native%20iOS%20bridge-components:%20[form%20menu%20overflow-menu]","req_cache_control":"","req_last_modified":"","req_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Hotwire Native iOS; Turbo Native iOS bridge-components: [form menu overflow-menu]"}
{"time":"2024-11-10T20:10:31.392845489Z","level":"INFO","msg":"Request","host":"botflip.com","port":80,"path":"/fp","request_id":"16e415f7-126c-427b-b3cc-1d1574086b66","status":200,"service":"botflip-web","target":"758358dbac20:3000","duration":45784619,"method":"GET","req_content_length":0,"req_content_type":"","resp_content_length":7,"resp_content_type":"text/html; charset=utf-8","client_addr":"172.71.154.231","client_port":"57550","remote_addr":"67.180.1.189","user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Hotwire Native iOS; Turbo Native iOS bridge-components: [form menu overflow-menu]","proto":"HTTP/1.1","scheme":"http","query":"fp=1542811075&b=WebKit&d=iPhone&o=iOS&sr=402x874&c=undefined&ua=Mozilla/5.0%20(iPhone;%20CPU%20iPhone%20OS%2018_0%20like%20Mac%20OS%20X)%20AppleWebKit/605.1.15%20(KHTML,%20like%20Gecko)%20Hotwire%20Native%20iOS;%20Turbo%20Native%20iOS%20bridge-components:%20[form%20menu%20overflow-menu]","req_cache_control":"","req_last_modified":"","req_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Hotwire Native iOS; Turbo Native iOS bridge-components: [form menu overflow-menu]"}
{"time":"2024-11-10T20:10:31.604023009Z","level":"INFO","msg":"Request","host":"botflip.com","port":80,"path":"/fp","request_id":"95613662-c2c5-4e36-9a29-ab1181f60d46","status":200,"service":"botflip-web","target":"758358dbac20:3000","duration":256980769,"method":"GET","req_content_length":0,"req_content_type":"","resp_content_length":7,"resp_content_type":"text/html; charset=utf-8","client_addr":"172.71.154.231","client_port":"57566","remote_addr":"67.180.1.189","user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Hotwire Native iOS; Turbo Native iOS bridge-components: [form menu overflow-menu]","proto":"HTTP/1.1","scheme":"http","query":"fp=1542811075&b=WebKit&d=iPhone&o=iOS&sr=402x874&c=undefined&ua=Mozilla/5.0%20(iPhone;%20CPU%20iPhone%20OS%2018_0%20like%20Mac%20OS%20X)%20AppleWebKit/605.1.15%20(KHTML,%20like%20Gecko)%20Hotwire%20Native%20iOS;%20Turbo%20Native%20iOS%20bridge-components:%20[form%20menu%20overflow-menu]","req_cache_control":"","req_last_modified":"","req_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Hotwire Native iOS; Turbo Native iOS bridge-components: [form menu overflow-menu]"}
{"time":"2024-11-10T20:11:17.136189627Z","level":"INFO","msg":"Request","host":"botflip.com","port":80,"path":"/m","request_id":"d8bc6946-1c1e-45a5-85ee-daf354f54767","status":200,"service":"botflip-web","target":"758358dbac20:3000","duration":388583929,"method":"GET","req_content_length":0,"req_content_type":"","resp_content_length":15525,"resp_content_type":"text/html; charset=utf-8","client_addr":"172.71.154.231","client_port":"57544","remote_addr":"67.180.1.189","user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Hotwire Native iOS; Turbo Native iOS bridge-components: [form menu overflow-menu]","proto":"HTTP/1.1","scheme":"http","query":"","req_cache_control":"","req_last_modified":"","req_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Hotwire Native iOS; Turbo Native iOS bridge-components: [form menu overflow-menu]"}
{"time":"2024-11-10T20:11:17.65792694Z","level":"INFO","msg":"Request","host":"botflip.com","port":80,"path":"/fp","request_id":"f2cf3b22-fbe5-4734-9f1f-f871ccea6495","status":200,"service":"botflip-web","target":"758358dbac20:3000","duration":35128459,"method":"GET","req_content_length":0,"req_content_type":"","resp_content_length":7,"resp_content_type":"text/html; charset=utf-8","client_addr":"172.71.154.230","client_port":"16180","remote_addr":"67.180.1.189","user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Hotwire Native iOS; Turbo Native iOS bridge-components: [form menu overflow-menu]","proto":"HTTP/1.1","scheme":"http","query":"fp=1542811075&b=WebKit&d=iPhone&o=iOS&sr=402x874&c=undefined&ua=Mozilla/5.0%20(iPhone;%20CPU%20iPhone%20OS%2018_0%20like%20Mac%20OS%20X)%20AppleWebKit/605.1.15%20(KHTML,%20like%20Gecko)%20Hotwire%20Native%20iOS;%20Turbo%20Native%20iOS%20bridge-components:%20[form%20menu%20overflow-menu]","req_cache_control":"","req_last_modified":"","req_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Hotwire Native iOS; Turbo Native iOS bridge-components: [form menu overflow-menu]"}
34code commented 2 days ago

I'm also on MacOS Sequoia Public Beta.. This could potentially be a reason.

34code commented 1 day ago

seems like localhost is also not working anymore.. hence i feel like this might be unrelated to kamal-proxy and a macOS beta issue with Xcode.

34code commented 5 hours ago

nvm. I upgraded the OS to developer beta (Version 15.2 Beta (24C5079e)) and the simulator started working again.. going to check remote on sim and then close this issue..

34code commented 5 hours ago

Ok its working again! I think it was some issue with the networking stack on the public beta..