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.
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
fix: Clean up how objects are managed when they are fetched #4909
fix: Clean up how objects are managed when they are fetched #4909
Changes from 7 commits
f48b18f
58aeab4
6f77c64
75ce4fb
f8d8737
732938a
91e9adf
108936a
cbc0ae3
ee5ef03
8532cd1
ba041a5
59085d9
81ec321
c9e36c9
73172d3
a1add7f
4b27d13
7b97ff5
901ad90
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of "refetch" could we use something like "export" or "re-export"? Most of the time "Fetch" means to get the object from the server (usually by name), but this isn't doing that again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
refetch
in this case is triggeringwidget.refetch()
, which was already named... but essentially is restarting the stream and fetching the data. I think thereexport
name probably doesn't fit here either, andrefetch
makes more sense (orJsWidget.refetch
should be renamed?). Thoughts?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this means that raced calls to
fetch(true)
andfetch(false)
are going to intermittently fail - probably need some clearer docs on this and other general usage of ownership.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was debating just having a separate method
take
instead of making it a boolean.Really you should only be calling one or the other (
true
orfalse
) depending on how you're managing the object, I wouldn't expect you'd want to call both.In any case, I can add a
verifyIsOwner()
here in thefalse
case, and throw if it's been called after afetch(false)
so it reduces a race that way, but you could still racefetch(false)
thenfetch(true)
I suppose.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised this works - VariableDefinition is meant for scope tickets...
Will think on it more, but I think I'd prefer we decompose this (or provide an interface and second impl) to let this be reexported-and-fetched.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, that was already there. Looks like I added this back when implementing JsWidget: #1888 (comment)
I may have misinterpreted that comment then.
Should be able to refactor the
WorkerConnection#getObject
methods; the only part of theJsVariableDefinition
that is actually used is thetype
and theid
used inexportScopeTicket