Use kingfisher to find that there is a probability that the image cannot be loaded - urlsession

The development environment is Xcode14.0.1. Recently, I found that I use kingfisher to continuously load pictures, go back to the background to refresh, and continue to slide the interface to load pictures. There is a small probability that the pictures cannot be loaded. At this time, the pictures of the entire app will be abnormal and cannot be loaded. After capturing the package, it was found that the request to download the image was not really sent, and the error message of "request timed out" was also received. Only killing the app and restarting will restore it.
I used version 6.3.0 before, and I still have this problem after replacing the latest version. I feel that there is a problem with URLSession, but I don't know how to solve it.

Related

How to prevent browser from loading js from memory cache by range?

I opened my website in Chrome last night, then closed that tab, but didn't close browser. Today I failed to open my site in a new tab because jQuery(not use CDN) hits a syntax error: unexpected end of input.
My site always hits this error no matter how many times I refresh. But the error didn't happen again after hard refresh.
This problem happens many times in recent months.
I checked Chrome devtool, it says my jquery.min.js is loaded from memory cache. And it is not a whole file, only contains part of jquery library. That's why I got syntax error.
I did some research from google:
The lifetime of memory cache is attach to the lifetime of render process, which roughly corresponds to a tab.
So if I create a new tab to visit my site, stands to reason, jQuery should not be loaded from memory cache.
I expect browser do not load my files from memory again if I visit site in new tab.
Is there anything I can do to locate the problem source and fix it?
EDIT (2019-05-13):
Today hit this error again, but fortunately, I found new point seems helpful to this problem.
This is that request:
See status code is 206 Partial Content (from memory cache).
And I have no idea why my request header contains 'Range' field.
You can't detect newtab in browser and load your jquery.min.js,But you can avoid loading from cache by adding timestamp into suffix of your lib like follows.
http://yoursite.com/lib/js/jquery.min.js?1557301884
You can achieve this in two ways
Case:1 If you are using server side page rendering means(PHP,JSP) just print the timestamp
Case:2 If Client side means some javascript stuff you have to do

I get an empty file for .har

I was always able to generate a .har file to help devs for troubleshooting issues. But recently I just get an empty file for that!
P.S. I use Chrome.
Does this happen on all websites? If not, wait patiently for file to export. Sometimes there are plenty of requests to save (for example some web socket stuff) and it takes time. Give it few minutes.
I am using Firefox 95 and I am having the same problem.
I noticed that the page has an problem will will not load completely. The loading indicator in the tab keeps animating.
I tried disabling cache and force refresh the page to get it to load completely.
After that, I was able to get a HAR file.

Flex Security Sandbox Violation just started happening

I have an http handler built and running on my website server. Code in flex generates a http request then navigates to the handler, which generates and streams back file information for the user to download.
Basically the request sends image data and the return result is a pptx stream with the image data in a powerpoint slide.
This worked fantastically this morning until about an hour ago. I have no idea what changed, but every swf I am building which attempts to access this handler is now giving me:
* Security Sandbox Violation *
Connection to https://g1.localhost/Turm/BounceBack.aspx halted - not permitted from https://g1.localhost/Turm/FlashApps/ImageAndExporting.swf?debug=true
I even fully qualified the BounceBack.aspx name (it was a relative url until just now) in case something was confusing the flash player, but as you can see, the url request and the swf are loaded from exactly the same domain (even the same virtual app in the web domain).
I have even added the physical filepath as a 'trusted folder' in my flash player security settings.
What gives? Anyone have any suggestions?
Using the Apache 4.9.1 SDK and latest version of flashplayer.
As mentioned, this worked all day yesterday and this morning. I cannot figure out what has changed, but am having no luck resolving the issue, source code has not changed.
Finally figured out what changed. I move the navigation to my ASPX handler into a seperate method that delays invoation till after a UI update. Becuase I use the same ui components for printing as well as exporting, I tested the updates with the print feature and that worked without error. About an our later, I noticed the handlers were failing. Since the url request is not handled inside a UI interaction event (Like MouseEvent.CLICK) the flash player was preventing the call. Once I moved the navigation back into the event handler, the sandbox violation went away.
If you ask me, not a very good error message due to the actual problem encountered, but ... you learn something every day.

Upload video to YouTube via V3-API with Flex/AS3

I am currently working on an AIR-Application to upload videos to youtube. Since I got the very absurd requirement to upload files up to 80GB (we do not need to discuss this, I also think it´s nonsense) I decided to use the resumable upload for uploading chunks, like descriped on https://developers.google.com/youtube/v3/guides/using_resumable_upload_protocol
But for some reason, if I add the Content-Range header, I always receive an Error #2032. If I do not add the Content-Range header, the upload works, but only for the first chunk.
Has anyone managed to upload a file with the V3 API in AS3/Flex ?
Error 2032 usually occurs when your program or running application goes non-responsive. Some common reasons for this..
Your Proxy Settings may be not valid
Your Website must be in the list of restrictions
Your cookies must be corrupted
Your ADD-ON's on your browser may be responsible
Your registry must be corrupted
Source : Adobe Forums
Okay, I found out, what the "problem" is.
After uploading a chunk, the youtube servers return HTTP 308, which will be assessed as an error. Actually it isn't, it is youtubes status for "Resume incomplete". So the solution is simply to add an EventListener for HTTP_RESPONSE_STATUS, check for status 308 and then keep sending the next chunk. HTTP 200, and therefore the COMPLETE-Event will only be fired after uploading the last chunk

Can Google Chrome be made to auto reload after network outage in kiosk scenario?

I have an unattended touch screen kiosk application which needs to be able to automatically reload the browser home page after a network outage has occurred. At the moment the browser will display an "Unable to connect to the internet" error and will wait for a manual reload to be carried out before proceeding. Can this be automated?
I've searched for plugins and have found some plugins which deal with auto-reload but they don't seem to work in this context. I am guessing that the plugin is only active when a page is loaded so in this case with an error condition, perhaps the plugin is not active.
One alternative might be to override the error page which is displayed by Chrome but I don't know if this is possible. I could then instantiate a Javascript timer to try a reload every n seconds for example. Is this possible?
I saw a suggestion to use frames to allow the outer frame (which is never refreshed) to keep trying the loading of an inner frame but I'm not keen to use frames unless there is no alternative. I also saw a suggestion to use AJAX calls to check if the network was working before attempting a page load but this seems overkill if there is a way to correct the error only when it has occurred rather than pre-empt an error for every page load.
Host system is Windows 7 by the way. I'm keen to keep the browser running if possible rather than kill and create a new browser process.
If you don't want to tackle chrome extension development, you could wrap your site in an iframe, and then periodically refresh the iframe from the parent frame. That way you don't need to worry about OS issues.
if the content were loaded from ajax from the start then the it could simply output a custom message on the page as it does a check via AJAX. Probably prevention over remedy is always recommended
Assuming linux, you could create an ifup script to simply relaunch the browser with something like
#!/bin/sh
killall google-chrome
DISPLAY=:0 google-chrome
On debian/ubuntu, edit /etc/network/interfaces to include a post-up line; Google ifupdown for other distros.
On windows, you'd do roughly the same with a PowerShell script.
If you really want the precise behaviour you describe (without restarting the whole browser), I suggest you develop a plugin/extension: http://code.google.com/chrome/extensions/getstarted.html
I know you are using Chrome, but in Firefox this is trivial by overriding the netError.xhtml page to do a setTimeout(location.reload, 10000);.