Hi. I'm having the exact same issue.
The common, and only suggestion, seems to be to use "credits" like a digital currency. I don't like this idea since my app is not a game.
I went down the road of "permanent context" you are describing, and trying to "assume" that the ID of the item is the one that user last clicked buy on.
As you know, the risk here is that link is easy to lose, Apple recommends app needs to be able to process a purchase at any given time, by registering observer on launch, but I can't do it because I don't have itemId to match then.
Please let me know if you have found a solution.