-
Notifications
You must be signed in to change notification settings - Fork 101
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
Return errors from terminatesession and traverseiterator in some cases #745
Comments
neo-modules/src/RpcServer/RpcServer.SmartContract.cs Lines 113 to 123 in 32bd86d
It won't return session id if
If |
True, thanks. It returns iterator ID, but not session ID. But iterator ID is still somewhat misleading IMO, so separating
This then leads to interesting replies:
Error codes are subject of #728 though, so the only question left here is |
Summary or problem description
We have the following cases for
terminatesession
andtraverseiterator
RPCs that can be improved IMO:SessionEnabled: false
terminatesession
will always returnfalse
in this case whiletraverseiterator
will always return an empty array. While not a big problem forterminatesession
this behavior is far more annoying fortraverseiterator
, especially on public servers that are not expected to have sessions enabled for security reasons. These servers will return session/iterator IDs frominvoke*
, but clients wouldn't be able to distinguish between iterator that has no elements and server that doesn't have sessions enabled.The behavior now is similar to
SessionEnabled: false
. And it's important for the client to separate session errors (client can use wrong ID or it may just expire) from empty iterator again.traverseiterator
The behavior now is similar to invalid session ID and it again is important for the client to know that the ID is invalid if that's the case.
Do you have any solution you want to propose?
Introduce and return new errors for the cases described above (see #728 also for specific code suggestions, although for this issue it's more important to have these errors handled as errors in the first place).
Where in the software does this update applies to?
The text was updated successfully, but these errors were encountered: