Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think I’ve finally figured out how to get rid of the timer.
There are generally two places we want to resolve a proxy object: to show it in the interface, and to use it in a command. Once resolved, we want to hold onto that value until one of two things happens: The command is finished using the object, or the interface was dismissed.
Common scenarios (and their effect on the proxy):
Select and do nothing.
Run a trigger.
Those are fine on their own, but an even more common scenario combines them in a weird order.
The problem with that was, between 1 and 3, the object could change so you could run the action on something you didn’t want.
The previous solution was to just hold onto the resolved object for 2 more seconds, but that broke workflows that used the same proxy in rapid succession.
Now, when the interface is dismissed, instead of blindly clearing the proxy cache, it will check to see why the interface was dismissed. If it’s because a command was run, it leaves the cache in place knowing that it will get cleared anyway when the command finishes. Otherwise, the cache is cleared immediately.
The only thing I’m not 100% comfortable with is the change to when the notifications are posted. It used to be more limited it seems, but I don’t know if that made a difference in practice.