Transaction.updates stream closes immediately for some customers

We have code similar to the following in our App.

Task.detached(priority: .background) {
    logger.log("starting listening for transaction updates")
    defer { logger.warning("stopped listening for transaction updates") }
    for await verificationResult in Transaction.updates {
      logger.log("processing transaction update")
      ...
    }
  }
}

This code gets run on App launch. From looking at logs for some customers in production, on macOS 13.4.1, it seems as though "stopped listening for transaction updates" gets logged almost immediately after "starting listening for transaction updates" and before any "processing transaction update" messages.

My original guess was that maybe this was caused by the user being logged out of the AppStore but this doesn't seem to be the case and I have been totally unable to reproduce it.

A customer suggested that it happens every time they received an App update from from the App Store but the may be correlation rather than causation. I can see from looking at the customers logs that they also don't appear to have an AppTransaction available when this situation happens.

My question is, under what conditions can the Transaction.updates stream get closed early like this? What action should we take in this scenario? Would restarting the stream again lead to an infinite start/stop loop?

I have submitted this to Apple as FB12509606 - "Transaction.updates stream closes immediately and Transactions missing"

I have a suspicion that this might be a different manifestation of the same problem discussed in this SO post

Transaction.updates stream closes immediately for some customers
 
 
Q