Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
import org.commcare.formplayer.beans.ResponseMetaData;
import org.commcare.formplayer.beans.SessionNavigationBean;
import org.commcare.formplayer.beans.SubmitResponseBean;
import org.commcare.formplayer.beans.menus.BaseResponseBean;
import org.commcare.formplayer.beans.menus.EntityDetailListResponse;
import org.commcare.formplayer.beans.menus.EntityDetailResponse;
import org.commcare.formplayer.beans.menus.LocationRelevantResponseBean;
import org.commcare.formplayer.beans.menus.*;
import org.commcare.formplayer.services.FormplayerStorageFactory;
import org.commcare.formplayer.services.MenuSessionFactory;
import org.commcare.formplayer.services.ResponseMetaDataTracker;
Expand Down Expand Up @@ -185,6 +182,10 @@ public BaseResponseBean navigateSessionWithAuth(@RequestBody SessionNavigationBe
sessionNavigationBean.getFormSessionId()
);

String domain = sessionNavigationBean.getDomain();
if (domain != null && domain.startsWith("co-carecoordination")) {
log4Hashes(response);
}
setResponseMetaData(response);

SubmitResponseBean formSubmissionResponse = handleAutoFormSubmission(request, sessionNavigationBean,
Expand All @@ -197,6 +198,25 @@ public BaseResponseBean navigateSessionWithAuth(@RequestBody SessionNavigationBe
}
}

private void log4Hashes(BaseResponseBean response) {

if (response instanceof EntityListResponse entityListResponse &&
entityListResponse.getEntities().length > 0 &&
entityListResponse.getHeaders().length > 0
) {
int fourHashCount = 0;
for (EntityBean entity : entityListResponse.getEntities()) {
Object[] data = entity.getData();
if (data.length > 0 && data[0] != null && data[0].toString().equals("####")) {
fourHashCount++;
}
}
if (fourHashCount > 0) {
log.error("USH-6370 response with " + fourHashCount + " leading #### in first column");
}
}
}

private void setResponseMetaData(BaseResponseBean response) {
ResponseMetaData responseMetaData = new ResponseMetaData(responseMetaDataTracker.isAttemptRestore(),
responseMetaDataTracker.isNewInstall());
Expand Down
Loading