Implement spider functionality for event synchronization
- Introduced a new `spider` package to manage connections to admin relays and synchronize events for followed pubkeys. - Added configuration options for spider mode in the application settings, allowing for different operational modes (e.g., follows). - Implemented callback mechanisms to dynamically retrieve admin relays and follow lists. - Enhanced the main application to initialize and manage the spider, including starting and stopping its operation. - Added tests to validate spider creation, callbacks, and operational behavior. - Bumped version to v0.17.14.
This commit is contained in:
@@ -35,6 +35,12 @@ func (l *Listener) HandleReq(msg []byte) (err error) {
|
||||
// var rem []byte
|
||||
env := reqenvelope.New()
|
||||
if _, err = env.Unmarshal(msg); chk.E(err) {
|
||||
// Provide more specific error context for JSON parsing failures
|
||||
if strings.Contains(err.Error(), "invalid character") {
|
||||
log.E.F("REQ JSON parsing failed from %s: %v", l.remote, err)
|
||||
log.T.F("REQ malformed message from %s: %q", l.remote, string(msg))
|
||||
return normalize.Error.Errorf("malformed REQ message: %s", err.Error())
|
||||
}
|
||||
return normalize.Error.Errorf(err.Error())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user