- Malaysia
- https://amjad.alsharafi.dev
- Joined on
2024-05-31
this is different from ServerEventType
, there, its using .to_string().into_bytes()
small thing, maybe better to rename event_type
to event
? shorter and its not just the type, as it contain the data as well
I would use this
serde_json::to_value(&self.event_type).unwrap()["data"].to_string().into_bytes())
first, we don't need to serialize the whole thing as it would include the…
In general, the ping mechanism is good, but added some notes on small parts of it
not sure if this >= 5
is intentional, since if someone set the ping time to be very short it will always return false
.
something I noticed, this nonce_limit
is just passed everywhere without a need.
I think both of these is better to be config as well, more configuration options for admin, 10 mins is good enough of course and probably won't change by most ppl
The separation between the type and event data and then checking manually with is_of_type
looks wrong.