Skip to content

Commit 37c44f9

Browse files
committed
Merge branch 'hotfix/1823-optional-phoneNumber-param'
2 parents 9055d1a + 04264c1 commit 37c44f9

File tree

4 files changed

+41
-9
lines changed

4 files changed

+41
-9
lines changed

GAE/src/com/gallatinsystems/diagnostics/app/web/RemoteExceptionRestServlet.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2010-2012 Stichting Akvo (Akvo Foundation)
2+
* Copyright (C) 2010-2016 Stichting Akvo (Akvo Foundation)
33
*
44
* This file is part of Akvo FLOW.
55
*
@@ -65,6 +65,7 @@ protected RestResponse handleRequest(RestRequest req) throws Exception {
6565
trace.setDeviceIdentifier(exReq.getDeviceIdent());
6666
trace.setPhoneNumber(exReq.getPhoneNumber());
6767
trace.setStackTrace(new Text(exReq.getStackTrace()));
68+
trace.setAndroidId(exReq.getAndroidId());
6869
stacktraceDao.save(trace);
6970
} else {
7071
throw new RestException(new RestError(RestError.BAD_DATATYPE_CODE,

GAE/src/com/gallatinsystems/diagnostics/app/web/dto/RemoteExceptionRequest.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2010-2012 Stichting Akvo (Akvo Foundation)
2+
* Copyright (C) 2010-2016 Stichting Akvo (Akvo Foundation)
33
*
44
* This file is part of Akvo FLOW.
55
*
@@ -19,6 +19,7 @@
1919
import java.text.DateFormat;
2020
import java.text.SimpleDateFormat;
2121
import java.util.Date;
22+
import java.util.Locale;
2223

2324
import javax.servlet.http.HttpServletRequest;
2425

@@ -37,7 +38,7 @@ public class RemoteExceptionRequest extends RestRequest {
3738
private static final ThreadLocal<DateFormat> DATE_FMT = new ThreadLocal<DateFormat>() {
3839
@Override
3940
protected DateFormat initialValue() {
40-
return new SimpleDateFormat(FORMAT_STRING);
41+
return new SimpleDateFormat(FORMAT_STRING, Locale.US); // Always specify a locale for M2M formatting
4142
};
4243
};
4344

@@ -48,12 +49,14 @@ protected DateFormat initialValue() {
4849
public static final String VERSION_PARAM = "version";
4950
public static final String DATE_PARAM = "date";
5051
public static final String TRACE_PARAM = "trace";
52+
public static final String ANDROID_ID_PARAM = "androidId";
5153

5254
private String phoneNumber;
5355
private String deviceIdent;
5456
private String version;
5557
private Date date;
5658
private String stackTrace;
59+
private String androidId;
5760

5861
public String getStackTrace() {
5962
return stackTrace;
@@ -95,13 +98,16 @@ public void setDate(Date date) {
9598
this.date = date;
9699
}
97100

101+
public String getAndroidId() {
102+
return androidId;
103+
}
104+
105+
public void setAndroidId(String androidId) {
106+
this.androidId = androidId;
107+
}
108+
98109
@Override
99110
protected void populateErrors() {
100-
if (phoneNumber == null || phoneNumber.trim().length() == 0) {
101-
addError(new RestError(RestError.MISSING_PARAM_ERROR_CODE,
102-
RestError.MISSING_PARAM_ERROR_MESSAGE, PHONE_PARAM
103-
+ " is required"));
104-
}
105111
if (date == null) {
106112
addError(new RestError(RestError.MISSING_PARAM_ERROR_CODE,
107113
RestError.MISSING_PARAM_ERROR_MESSAGE, DATE_PARAM
@@ -115,6 +121,7 @@ protected void populateFields(HttpServletRequest req) throws Exception {
115121
deviceIdent = req.getParameter(DEV_ID_PARAM);
116122
version = req.getParameter(VERSION_PARAM);
117123
stackTrace = req.getParameter(TRACE_PARAM);
124+
androidId = req.getParameter(ANDROID_ID_PARAM);
118125
if (req.getParameter(DATE_PARAM) != null
119126
&& req.getParameter(DATE_PARAM).trim().length() > 0) {
120127
try {

GAE/src/com/gallatinsystems/diagnostics/domain/RemoteStacktrace.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2010-2012 Stichting Akvo (Akvo Foundation)
2+
* Copyright (C) 2010-2016 Stichting Akvo (Akvo Foundation)
33
*
44
* This file is part of Akvo FLOW.
55
*
@@ -38,6 +38,16 @@ public class RemoteStacktrace extends BaseDomain {
3838
private String softwareVersion;
3939
private Boolean acknowleged = new Boolean(false);
4040
private Date errorDate;
41+
private String androidId;
42+
private String ood;
43+
44+
public String getOod() {
45+
return ood;
46+
}
47+
48+
public void setOod(String ood) {
49+
this.ood = ood;
50+
}
4151

4252
public Boolean getAcknowleged() {
4353
return acknowleged;
@@ -87,4 +97,12 @@ public void setErrorDate(Date errorDate) {
8797
this.errorDate = errorDate;
8898
}
8999

100+
public String getAndroidId() {
101+
return androidId;
102+
}
103+
104+
public void setAndroidId(String androidId) {
105+
this.androidId = androidId;
106+
}
107+
90108
}

RELEASE_NOTES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ Read more about the [Akvo Platform](http://www.akvo.org/blog/?p=4822).
55

66
Akvo FLOW Dashboard release notes
77
----
8+
#1.9.11.1 Jubilant Jaguar Hotfix
9+
Date: 7 December 2016
10+
11+
# Resolved issues
12+
* **RemoteException calls failing** [#1823] - The backend has been failing to process error messages from devices with more recent versions of Android because their `phoneNumber` attribute was missing. The consequence is that devices have been constantly resubmitting these error messages, and using up unnecessary resources on the backend
13+
814
#1.9.11 Jubilant Jaguar
915
Date: 7 November 2016
1016

0 commit comments

Comments
 (0)