-
Notifications
You must be signed in to change notification settings - Fork 173
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
fix(rpc module): fail subscription calls with bad params #728
Merged
niklasad1
merged 44 commits into
master
from
na-jsonrpsee-pubsub-should-not-respond-to-bad-params
Apr 20, 2022
Merged
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
d6d9e5a
fix(rpc module): fail subscription with bad params
niklasad1 cabdb41
draft; show my point
niklasad1 8c8a590
fix tests
niklasad1 520e27d
fix build
niklasad1 3d750e1
add tests for proc macros too
niklasad1 03b7787
add tests for bad params in proc macros
niklasad1 c7f8eed
fix nits
niklasad1 1b34a49
commit all files
niklasad1 3d5256d
add ugly fix for proc macro code
niklasad1 e62d1ac
add more user friendly API
niklasad1 b40f95b
make SubscriptionSink::close take mut self
niklasad1 aff9ee7
fix grumbles
niklasad1 17ef15b
show james some code
niklasad1 4bc82f6
Update core/src/server/rpc_module.rs
niklasad1 7f4cd8f
remove needless clone
niklasad1 66c6dff
fix build
niklasad1 568ae7c
Merge remote-tracking branch 'origin/na-jsonrpsee-pubsub-should-not-r…
niklasad1 82a5a87
client fix docs + error type
niklasad1 68a52a0
simplify code: merge connect reset and unsubscribe close reason
niklasad1 a3e50ed
remove unknown close reason
niklasad1 9c041bd
refactor: remove Error::SubscriptionClosed
niklasad1 e857f20
add some nice APIs to ErrorObjectOwned
niklasad1 bdc9075
unify api
niklasad1 8ebdf6c
address grumbles
niklasad1 84048b4
remove redundant methods for close and reject
niklasad1 332f377
proc macro: compile err when subscription -> Result
niklasad1 cb6da3d
rpc module: fix test subscription test
niklasad1 698c8eb
Update core/src/server/rpc_module.rs
niklasad1 d86c231
Update core/src/server/rpc_module.rs
niklasad1 e6e3aea
Update core/src/server/rpc_module.rs
niklasad1 d741f43
Update core/src/server/rpc_module.rs
niklasad1 7c6f67f
Update core/src/server/rpc_module.rs
niklasad1 409acd1
Update proc-macros/src/lib.rs
niklasad1 61921d1
address grumbles
niklasad1 02fce6b
Merge remote-tracking branch 'origin/na-jsonrpsee-pubsub-should-not-r…
niklasad1 06951c9
remove faulty comment
niklasad1 d81fbf4
Update core/src/server/rpc_module.rs
niklasad1 def9392
Update core/src/server/rpc_module.rs
niklasad1 2576d0f
Update core/src/server/rpc_module.rs
niklasad1 a921d47
Update core/src/server/rpc_module.rs
niklasad1 036ea6b
Update core/src/server/rpc_module.rs
niklasad1 07ba3b3
fix: don't send `RPC Call failed: error`.
niklasad1 83081d1
remove debug assert
niklasad1 3da7b0f
Merge remote-tracking branch 'origin/na-jsonrpsee-pubsub-should-not-r…
niklasad1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So here, the backend has sent back something like this I think?:
As a result, we close the subscription on the client. Right now, we don't pass on that error to the client though? (this may have been what you were getting at in a previous comment and I'm just catching up now :))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, because I was lazy because o the lifetime issues with serde.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK that makes sense; if it's a bit of a pain to do, let's add an issue to address this separately if it's not important to Substrate!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no this is just the client code so shouldn't matter