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

endo make leaves behind temp bundle if make() result is bad #2290

Closed
FUDCo opened this issue May 16, 2024 · 1 comment · Fixed by #2292
Closed

endo make leaves behind temp bundle if make() result is bad #2290

FUDCo opened this issue May 16, 2024 · 1 comment · Fixed by #2292
Assignees
Labels
bug Something isn't working

Comments

@FUDCo
Copy link
Collaborator

FUDCo commented May 16, 2024

Describe the bug

I'm not 100% sure what the required nature of the result returned by the make() function defining a worker should be (I suspect it's supposed to be serializable), but if you return something unsuitable (such as a function) and creating the worker required creating a temp bundle, the temp bundle will be left behind as debris.

Steps to reproduce

Create the following nonsense worker source file zot.js:

export const make = () => {
  return () => 47;
}

If you then try to use it with endo make -name stuff zot.js it produces an error:

CapTP cli exception: (RemoteError(error:captp:Endo#20001)#1)
RemoteError(error:captp:Endo#20001)#1: Remotables must be explicitly declared: "[Function <anon>]"
  at makeError (file:///Users/chip/GitRepos/endo/packages/ses/src/error/assert.js:347:61)
  at decodeErrorCommon (file:///Users/chip/GitRepos/endo/packages/marshal/src/marshal.js:309:24)
  at decodeErrorFromCapData (file:///Users/chip/GitRepos/endo/packages/marshal/src/marshal.js:337:14)
  at decodeFromCapData (file:///Users/chip/GitRepos/endo/packages/marshal/src/encodeToCapData.js:382:27)
  at fromCapData (file:///Users/chip/GitRepos/endo/packages/marshal/src/marshal.js:401:23)
  at CTP_RETURN (file:///Users/chip/GitRepos/endo/packages/captp/src/captp.js:696:24)
  at dispatch (file:///Users/chip/GitRepos/endo/packages/captp/src/captp.js:775:7)
  at file:///Users/chip/GitRepos/endo/packages/daemon/src/connection.js:36:7
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

(RemoteError(error:captp:Endo#20001)#1)

A subsequent endo list command produces:

AGENT
APPS
ENDO
INFO
NETS
NONE
SELF
stuff
tmp-bundle-ac5d43080cd293fe6348d5a5f3c869d1

Expected behavior

The temp bundle should not be left behind.

NOTE: If the zot.js file simply contains syntactically invalid JavaScript, the temp bundle is cleaned up properly.

@FUDCo FUDCo added the bug Something isn't working label May 16, 2024
@FUDCo
Copy link
Collaborator Author

FUDCo commented May 16, 2024

Note: I have a fix but apparently no longer have access to the repo.

FUDCo added a commit that referenced this issue May 16, 2024
@FUDCo FUDCo self-assigned this May 16, 2024
FUDCo added a commit that referenced this issue May 16, 2024
FUDCo added a commit that referenced this issue May 17, 2024
FUDCo added a commit that referenced this issue May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant