Huh. How long does it take to expire once you enter the background? What does the console log show (particularly from "duet") when your task is expired?
It can be a few minutes. I haven't time it.
As background context, what's the work you're actually "doing"?
I'm curious to why this would make a difference. It is running a long initial sync of data loading data into CoreData from a server. It almost always dies when trying to load relationships into CoreData. We are talking about 7000 plus relationship connections.
How fast is that progress in real-world terms?
A minute or two.
How long does it take to process "one" item?
A fraction of a second, I don't have exact times.
How often are you updating progress?
Many times a second.
if you reduce the work such that you make "rapid" progress, both in terms of how long you take to complete and how frequently you report progress?
I can't reduce how long it takes to update CoreData, On an initial sync, it's all or nothing; otherwise data will be corrupted.
I broke up the work to advance the progress bar, showing faster updates. Example, 1000 at a time, updating from 0 to 1000. The user feedback is noticeably faster, but the expirationHandler still gets called.
This initial sync is rare from a user perspective. Some may never have initial syncs that will take 2-3 minutes.
Question is 2-3 minutes outside the use case for this new feature?