SandstormApi.save() currently may do the wrong thing when given a promise capability, due to an interaction with RealmGateway: If the promise points back into the sandbox realm, then sandstormpi.save will intercept the SystemPersistent.save() call and change it to AppPersistent.save(). However, if the promise later resolves to a capability outside of the sandbox realm, then the AppPersistent.save() call will bounce back out, but sandstormpi.save blocks outbound save() calls since the app is supposed to call SandstormApi.save() instead.
To solve this, the inbound translation from SystemPersistent to AppPersistent should first wait for promise resolution.
Meanwhile, we should deprecate RealmGateway and use the membrane framework instead.
As a work-around, you can wait for promises to settle before calling save().
SandstormApi.save()
currently may do the wrong thing when given a promise capability, due to an interaction withRealmGateway
: If the promise points back into the sandbox realm, thensandstormpi.save
will intercept theSystemPersistent.save()
call and change it toAppPersistent.save()
. However, if the promise later resolves to a capability outside of the sandbox realm, then theAppPersistent.save()
call will bounce back out, butsandstormpi.save
blocks outboundsave()
calls since the app is supposed to callSandstormApi.save()
instead.To solve this, the inbound translation from
SystemPersistent
toAppPersistent
should first wait for promise resolution.Meanwhile, we should deprecate
RealmGateway
and use the membrane framework instead.As a work-around, you can wait for promises to settle before calling
save()
.