endo icon indicating copy to clipboard operation
endo copied to clipboard

missing Remotable and PassByRef types

Open turadg opened this issue 2 years ago • 9 comments

The description is correct but its type is aliased to Passable (which is wrong). Moreover since Passable is any, Passable is any.

https://github.com/endojs/endo/blob/686ab61802c0e5206b14f4b91d499e3873555cd4/packages/pass-style/src/types.js#L20-L74

https://docs.agoric.com/guides/js-programming/far.html

Remotable = Far object or local presence for a Far object (can be done with a tag b/c only Far() and unserialize return it)

PassByCopy needs a def.

PureData is deeply PassByCopy. (currently Passable/any)

PassByRef = Remotable | Promise<Remotable> | Promise<PassByCopy> (in snippet as PassableCap)

Passable = PassByRef | PassByCopy (but probably not feasible to fully define)

@gibson042 points out adjustments may be needed for error handling

turadg avatar Feb 07 '23 18:02 turadg

PassByCopy !== PureData

PassByCopy is shallow. PureData is deeply PassByCopy. harden([Far('x',{})]) is a PassByCopy CopyArray, but is not PureData because it contains a Remotable.

erights avatar Feb 08 '23 20:02 erights

@gibson042 points out adjustments may be needed for error handling

Points out where? Or what?

erights avatar Feb 08 '23 20:02 erights

Remotable = Far object or local presence for a Far object (can be done with a tag b/c only Far() and serialize return it)

Did you mean "unserialize"?

erights avatar Feb 08 '23 20:02 erights

PassByRef = Remotable | Promise | Promise (in snippet as PassableCap)

What does the third disjunct mean?

erights avatar Feb 08 '23 20:02 erights

For context, this issue body was from a huddle (@gibson042, @dckc and me)

PassByCopy !== PureData

Thanks. I've updated the body.

Points out where? Or what?

It was merely a verbal statement like "adjustments may be needed for error handling" (paraphrase)

Did you mean "unserialize"?

Yes, corrected.

What does the third disjunct mean?

Markdown interpreted the <> as HTML tag. I've now wrapped in backticks.

turadg avatar Feb 08 '23 21:02 turadg

What’s the status of this change?

kriskowal avatar Jan 08 '24 20:01 kriskowal

What’s the status of this change?

This is an issue so no changes have yet been made.

I'd still like to see this problem solved. The any cropped up for me again in https://github.com/endojs/endo/pull/1928 just now.

I'll see if I can make some progress today

turadg avatar Jan 08 '24 20:01 turadg

Wondering if this is linked, and possibly was worked around by the manual type generation step before publish

mhofman avatar Jan 08 '24 21:01 mhofman

Decided this is high priority in the endo project meeting cc @turadg

aj-agoric avatar Jan 31 '24 19:01 aj-agoric