Don't panic when signing event fails. #768

Merged
Zeyphros merged 2 commits from fix_panic_on_long_message into next 2022-05-28 20:47:16 +00:00
Zeyphros commented 2022-04-08 20:08:28 +00:00 (Migrated from gitlab.com)

Fixes panics when an overly long message is sent

Fixes #232


  • I agree to release my code and all other changes of this MR under the Apache-2.0 license
Fixes panics when an overly long message is sent Fixes #232 ----------------------------------------------------------------------------- - [x] I agree to release my code and all other changes of this MR under the Apache-2.0 license
timokoesters (Migrated from gitlab.com) approved these changes 2022-04-08 20:08:28 +00:00
M0dEx commented 2022-04-08 22:49:18 +00:00 (Migrated from gitlab.com)

Wouldn't it be nicer to have a helper function for signing that would handle errors like this, as there are 5 uses of the hash_and_sign_event() function with .expect() in the code base?

Wouldn't it be nicer to have a helper function for signing that would handle errors like this, as there are 5 uses of the hash_and_sign_event() function with `.expect()` in the code base?
Zeyphros commented 2022-04-10 11:51:09 +00:00 (Migrated from gitlab.com)

I'm not sure where such a wrapper function could reasonably be located.

In some cases the error is simply mapped to ErrorKind::InvalidParam eg in server_server.rs:2971 instead of a more accurate function. Other times a panic is caused through expects.

Maybe a good solution would be a helper function which maps a ruma::signatures::Error to a conduit Error?

I'm not sure where such a wrapper function could reasonably be located. In some cases the error is simply mapped to ErrorKind::InvalidParam eg in `server_server.rs:2971` instead of a more accurate function. Other times a panic is caused through expects. Maybe a good solution would be a helper function which maps a `ruma::signatures::Error` to a conduit Error?
timokoesters commented 2022-04-11 16:07:03 +00:00 (Migrated from gitlab.com)

"too long"

"too long"
Zeyphros commented 2022-04-12 22:09:01 +00:00 (Migrated from gitlab.com)

changed this line in version 2 of the diff

changed this line in [version 2 of the diff](/famedly/conduit/-/merge_requests/343/diffs?diff_id=372397226&start_sha=07a3a6fa9a9f8c00788fb262dd19139bd2c22192#2e504c38449e781e324bf3552f454530d910d227_1951_1950)
Zeyphros commented 2022-04-12 22:09:03 +00:00 (Migrated from gitlab.com)

added 1 commit

Compare with previous version

added 1 commit <ul><li>090d0fe6 - Fix typo</li></ul> [Compare with previous version](/famedly/conduit/-/merge_requests/343/diffs?diff_id=372397226&start_sha=07a3a6fa9a9f8c00788fb262dd19139bd2c22192)
timokoesters commented 2022-05-28 20:46:20 +00:00 (Migrated from gitlab.com)

approved this merge request

approved this merge request
timokoesters commented 2022-05-28 20:47:16 +00:00 (Migrated from gitlab.com)

mentioned in commit 39bc84d81c

mentioned in commit 39bc84d81c07049f803ec75c8cd706e8099b8481
timokoesters commented 2022-06-23 07:31:08 +00:00 (Migrated from gitlab.com)

mentioned in issue #254

mentioned in issue #254
Sign in to join this conversation.
No reviewers
No labels
Android
CS::needs customer feedback
CS::needs follow up
CS::needs on prem installation
CS::waiting
Chrome
Design:: Ready
Design:: in progress
Design::UX
E2EE
Edge
Firefox
GDPR
Iteration 13 IM
Linux
MacOS
Need::Discussion
Need::Steps to reproduce
Need::Upstream fix
Needs:: Planning
Needs::Dev-Team
Needs::More information
Needs::Priority
Needs::Product
Needs::Refinement
Needs::Severity
Priority::1-Critical
Priority::2-Max
Priority::3-Impending
Priority::4-High
Priority::5-Medium
Priority::6-Low
Priority::7-None
Progress::Backlog
Progress::Review
Progress::Started
Progress::Testing
Progress::Triage
Progress::Waiting
Reporter::Sentry
Safari
Target::Community
Target::Customer
Target::Internal
Target::PoC
Target::Security
Team:Customer-Success
Team:Design
Team:Infrastructure
Team:Instant-Messaging
Team:Product
Team:Workflows
Type::Bug
Type::Design
Type::Documentation
Type::Feature
Type::Improvement
Type::Support
Type::Tests
Windows
blocked
blocked-by-spec
cla-signed
conduit
contribution::advanced
contribution::easy
contribution::help needed
from::review
iOS
p::ti-tenant
performance
product::triage
proposal
refactor
release-blocker
s: dart_openapi_codegen
s::Famedly-Patient
s::Org-Directory
s::Passport-Generator
s::Requeuest
s:CRM
s:Famedly-App
s:Famedly-Web
s:Fhiroxide
s:Fhiroxide-cli
s:Fhiroxide-client
s:Fhirs
s:Hedwig
s:LISA
s:Matrix-Dart-SDK
s:Role-Manager
s:Synapse
s:User-Directory
s:WFS-Matrix
s:Workflow Engine
s:dtls
s:famedly-error
s:fcm-shared-isolate
s:matrix-api-lite
s:multiple-tab-detector
s:native-imaging
severity::1
severity::2
severity::3
severity::4
technical-debt
voip
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Matthias/conduit#768
No description provided.