-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
This has impacted the flutter inspector requiring us to keep a ring of JSON strings alive with custom code on the dart side just to be able to fetch their contents before the InstanceRef objects are GCed between when we get an InstanceRef object and when we get the Instance object associated with the InstanceRef.
For example, see: [https://github.com/flutter/flutter/pull/16638/files/da7bf29ae05659caf6aba20e0e56e3ca6c5285e9#diff-f01fcfe0b7237b22d168496f69be49baR811]
We aren't blocked on the inspector side due to the workaround but I am concerned this could also sometimes impact regular debugger watch window display behavior as values shown in the watch window may expire before their full contents can be displayed to a user particularly for debuggers that want to show a large string value to the user.
For example, suppose the user types
x.foo
in a debugging watch window where foo is property that returns a large new string on each property lookup.
Currently there is always a risk that the value of x.foo will be GCed before a debugging client can retrieve the full String even if the debugging client attempts to load the full value directly as the getInstance method call is required to go from a InstanceRef missing the full string contents to an Instance object.
I suppose the current design is a debugging client should keep retrying x.foo until it gets a value that isn't a sentinel but this seems unnecessarily complex when all we really need is to be able to keep specific objects alive until the current string of debugging objects is complete.