#"Bad resource ID" error, despite `resource_table.has(rid)` being true when using `deno_runtime`

4 messages · Page 1 of 1 (latest)

livid panther
#

Hey, currently having an issue when trying to call a host operation that wants to access a previously set resource on the OpState::resource_table. What's confusing right now is that when we check the .has(rid) on resource_table it comes back as true but when I try to use the .get(rid) it errors.

println!("Has RID: {}", rt.has(rid));
println!("RID: {:?}", rt.get::<AuraeScriptConfig>(config));

results in:

Has RID: true
RID: Err(Bad resource ID)

Any ideas? We weren't seeing this issue when we were using just deno_core but have switched to deno_runtime and are now seeing it.

Here is the PR with repro: https://github.com/aurae-runtime/aurae/pull/474/files (line 62 in auraescript/src/builtin/auraescript_client.rs)

flat hound
#

@livid panther rt.has simply check if the resource_id exists in the table where rt.get::<T> checks if T is present and has the provided resource_id

#

So i guess, AuraeScriptConfig is not present in the resource_table

#

btw you should make as__aurae_config__try_default and as__aurae_config__from_options synchronous functions.