-
Notifications
You must be signed in to change notification settings - Fork 36
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
handle larger messages #531
Conversation
🦋 Changeset detectedLatest commit: c5501e1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@felicio is attempting to deploy a commit to the Status Team on Vercel. A member of the Team first needs to authorize it. |
note: addressing #529 (comment) |
relates: status-im/status-go#4922 |
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.
LGTM. Lack a bit of context but left a comment.
let decodedMetadata | ||
try { | ||
decodedMetadata = ApplicationMetadataMessage.fromBinary(messageToDecode) | ||
} catch { | ||
return | ||
} | ||
|
||
if (!decodedMetadata.payload) { | ||
return | ||
} | ||
|
||
if (!decodedMetadata.signature.length) { | ||
return | ||
} | ||
|
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.
Overall, I think the code is a bit verbose and makes it harder to read and maintain. Maybe joining these conditions will help a bit.
if (!decodedMetadata || !decodedMetadata.payload || !decodedMetadata.signature.length) {
return;
}
Also i see you're not handling the error. Wouldn't you use it somehow in this case?
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.
In the current context, it's an invalid message that's worth skipping, I believe. I do think it's worth monitoring invalid messages, their size and rate but on anohter level, I'd say.
No description provided.