Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background proxy side-effects #2489

merged 2 commits into from Jul 27, 2019

Background proxy side-effects #2489

merged 2 commits into from Jul 27, 2019


Copy link

@skurfer skurfer commented Mar 19, 2019

I was trying to show nicer details for a proxy object by pulling them from the resolved object, but calling resolvedObject while getting details tends to happen before the object gets selected in the main interface. (I think because it appears in the results during a partial match.) That forces the object to be resolved and cached before it’s actually displayed.

There also seems to be something calling for details just after the interface is dismissed, which is even worse because of this sequence:

  1. The user dismisses the interface
  2. The proxy cache is intentionally cleared
  3. Something calls detailsOfObject: which calls resolvedObject which grabs and immediately re-caches the current value of the proxy

Then, sometime later:

  1. The user calls up the proxy
  2. It has a (potentially very old) cached value, so that gets returned

I’m not sure what the best answer is here, other than for developers to avoid calling resolvedObject when they just want the already resolved value. So for now, this gives us a way to do that.

skurfer added 2 commits Mar 19, 2019
Calling resolvedObject from background tasks can have weird side-effects. Sometimes you just want to get what’s available without forcing resolution.
Copy link

pjrobertson commented Jul 27, 2019

I'm assuming you're planning on doing something with cachedProxyTarget once it's merged, so I'll merge this and wait and see!

@pjrobertson pjrobertson merged commit b21dbf1 into master Jul 27, 2019
@pjrobertson pjrobertson deleted the bgproxy branch Jul 27, 2019
Copy link
Member Author

skurfer commented Jul 29, 2019

Yeah, I was going to use it in the Zoom plug-in. It turns out this didn’t really solve the problem, but including it is pretty harmless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants