Built-in Preview window making several requests at the same time
I am using the built-in preview to check my remote code after I upload it to the server. I do this periodically. Recently I started to notice that if I do it very often after a while my server started to reply with 508. I checked the logs and it seems the AppleWebKit is making several requests at once instead of just 1 normal request. The more I use it seems the more requests it makes. it seems it goes back to normal if kill Textastic and open it again. I suspect the Preview window is not getting killed properly and is running on the background.
Customer support service by UserEcho
I am using Textastic 9.5
I am writing a PWA. I.notice after closing the preview window to examine my code, that many of the 'Alerts' in my code keep 'popping up' on the code screen, even though to my knowledge the program has stopped running as I tapped DONE after running the code, and assume the program stops running. But as Miguel suggest, maybe the code is still executing or is still running in the background. In order to continue editing my code I have to close multiple alert windows that have their origin in my program code. After doing this I can continue editing code as expected. BTW thanks for a great code editor. Textastic is fantastic!
Thanks, I'll look into it and will try to reproduce the problem.
Any luck reproducing the problem? As someone suggested the best way might be to just add an alert() window in JS. You’ll notice it will start popping up more than once after using the preview window for a while. Thanks for the lovely app!
Thank you again Alexander for a FANTASTIC app!
Using Textastic 9.5, iPad Pro 9.7" iOS 14.3
Thanks for reminding me. I'll try finding out more this week.
I found the problem: Textastic's web preview view controller and the contained WKWebView instance was never freed and continued to run in the background because of a retain cycle:
I fixed this retain cycle now, so that the all web view resources and script handlers are freed when tapping the Done button.
I'll prepare a new release.
WOW, and THANKYOU! As a Textastic devotee I am really pleased that Alex was able to confirm, and fix the above issue! I have multiple iterations of event handlers and frequent use of console.log calls and alerts for troubleshooting and so my current Java script code was quite vulnerable to being bothered by WebKit not being nice to TEXTASTIC’S 'Done' button. Thank you to Miguel also for bringing this issue to light, as it would never have occurred to me that some debugging issues I was having related to WebKit and not my own amateurish code! Thank you again Alexander for sleuthing this out and fixing it! Rest assured that all of us iOS/ iPad devoted Textastic coders out there REALLY APPRECIATE all the work you do in bringing us Textastic!
The new version 9.5.1 includes the bug fix and should be available on the App Store now.
Please let me know if this does indeed fix the problem.
Thanks for the quick fix. I already updated the app but I have not tried it yet. I will give it a try later today or tomorrow.
I have not done a lot of testing but seems fixed. I am no longer hitting the Entry Process of my shared hosting which was happening quite often before (the limit is 20 so I only had to open/close the window 20 times). Thanks again for fixing it and for the amazing app. Keep up the good work.