You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey Leonardo Cardoso! Just wanted to say big thank you to a cool little kit of code making it really easy to get a preview of a URL! ❤️
Certain links, however, will cause the previewer to get down to the Regex.pregMatchAll() method and there it will churn pretty much indefinitely, tasking one of the cores to maximum. Because it's already beyond the request part, it's unable to be cancelled at that point. It will continue to task the CPU as you navigate around the app, but at least it stops when the app is backgrounded.
(Edit: Updated with a version that doesn't use a cache, and with cancel button)
I know, it's crude, but it tests one working link preview and the bad link.
Xcode: 11.3.1
iOS targeted: 11.x, 12.x, 13.x
Stack trace and time graph shown above
Let me know if you'd like any more help.
The text was updated successfully, but these errors were encountered:
Hey Leonardo Cardoso! Just wanted to say big thank you to a cool little kit of code making it really easy to get a preview of a URL! ❤️
Certain links, however, will cause the previewer to get down to the Regex.pregMatchAll() method and there it will churn pretty much indefinitely, tasking one of the cores to maximum. Because it's already beyond the request part, it's unable to be cancelled at that point. It will continue to task the CPU as you navigate around the app, but at least it stops when the app is backgrounded.
Example URL: https://news.ycombinator.com/item?id=22598009
Would you have any suggestion on how to handle a case like this, or a way/means to cancel the churning after a specific amount of time has passed?
For now, I will try and collect bad URLs and just avoid sending them to the previewer
Here's a sample project to test with:
(Edit: Updated with a version that doesn't use a cache, and with cancel button)
I know, it's crude, but it tests one working link preview and the bad link.
Xcode: 11.3.1
iOS targeted: 11.x, 12.x, 13.x
Stack trace and time graph shown above
Let me know if you'd like any more help.
The text was updated successfully, but these errors were encountered: