Skip to content

Commit

Permalink
Fix for missing device info. Also additional log messages (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
ipatini authored Nov 22, 2024
1 parent 1a02765 commit d79877b
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,20 @@ private void processResponse(@NonNull Map<String, Object> response) {
boolean doArchive = false;
Object obj = response.get("nodeInfo");
log.warn("RegistrationRequestProcessor: processResponse: nodeInfo: {} {}", obj==null?null:obj.getClass().getTypeName(), obj);

// If device info are missing copy them from the registration request
if (obj==null || obj instanceof Map && ((Map) obj).isEmpty()) {
log.warn("RegistrationRequestProcessor: processResponse: nodeInfo: ** NO DEVICE INFO IN RESPONSE **");
if (! registrationRequest.getDevice().getDeviceInfo().isEmpty()) {
obj = registrationRequest.getDevice().getDeviceInfo();
log.warn("RegistrationRequestProcessor: processResponse: nodeInfo: ** DEVICE INFO COPIED FROM REGISTRATION REQUEST **");
log.warn("RegistrationRequestProcessor: processResponse: nodeInfo: {}", obj);
} else {
log.warn("RegistrationRequestProcessor: processResponse: nodeInfo: ** PROBLEM: REGISTRATION REQUEST DOES NOT CONTAIN DEVICE INFO EITHER **");
}
}
log.warn("RegistrationRequestProcessor: processResponse: CHECK: ** NOT A REAL EXCEPTION **\n", new RuntimeException("NOT A REAL EXCEPTION"));

if (obj instanceof Map devInfo) {
// Update request info
registrationRequest.setLastUpdateDate(Instant.ofEpochMilli(timestamp));
Expand Down

0 comments on commit d79877b

Please sign in to comment.