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

returning "hashmap" tables with 0 as key for a val fails silently or crashes AOS #261

Open
nikooo777 opened this issue Jun 5, 2024 · 0 comments

Comments

@nikooo777
Copy link

assume this table:

{
   0 = "value here"
}

with 0 being an integer (if it's a string it works fine).

if this table (t) is bundled like this:

secretObj = {Secrets = t}

the resulting value should be:

{
   Secrets = {
     0 = "value here"
  }
}

now, if secretObj is returned like this:

Handlers.utils.reply(secretObj)(msg)

it will somewhat silently fail. using a dry run, this is what I see in the network tab:

{"Messages":[],"Assignments":[],"Spawns":[],"Output":"","Error":{}}

using AOS acutally causes a crash:

aos> Send({Target=ao.id, Data=secretObj})
file:///home/niko/.nvm/versions/node/v20.12.0/lib/node_modules/@permaweb/aos/src/services/errors.js:17
  const errorMessage = error.replace(
                             ^

TypeError: error.replace is not a function
    at parseError (file:///home/niko/.nvm/versions/node/v20.12.0/lib/node_modules/@permaweb/aos/src/services/errors.js:17:30)
    at Interface.<anonymous> (file:///home/niko/.nvm/versions/node/v20.12.0/lib/node_modules/@permaweb/aos/src/index.js:332:25)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v20.12.0
@TillaTheHun0 TillaTheHun0 transferred this issue from permaweb/ao Jun 5, 2024
@jfrain99 jfrain99 assigned jfrain99 and unassigned jfrain99 Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants