mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-19 19:46:50 +00:00
Log first part of RelayMessage when it cannot be deserialized from JSON, so the event.id can be chased down and the issue figured out.
As an example, I found someone had 'p' tags with npub values in them.
This commit is contained in:
parent
8f42829cb4
commit
21b725f11d
@ -9,7 +9,16 @@ impl Minion {
|
||||
// TODO: pull out the raw event without any deserialization to be sure we don't mangle
|
||||
// it.
|
||||
|
||||
let relay_message: RelayMessage = serde_json::from_str(&ws_message)?;
|
||||
let relay_message: RelayMessage = match serde_json::from_str(&ws_message) {
|
||||
Ok(rm) => rm,
|
||||
Err(e) => {
|
||||
tracing::error!(
|
||||
"RELAY MESSAGE NOT DESERIALIZING: starts with \"{}\"",
|
||||
&ws_message.chars().take(300).collect::<String>()
|
||||
);
|
||||
return Err(e.into());
|
||||
}
|
||||
};
|
||||
|
||||
let mut maxtime = Unixtime::now()?;
|
||||
maxtime.0 += 60 * 15; // 15 minutes into the future
|
||||
|
Loading…
Reference in New Issue
Block a user