Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Version 1.7.10
--------------

- Android Plugin: Look for properties file directly under flavor directory. (thanks biggestT)
- Drop events when the server returns an HTTP 429.

Version 1.7.9
-------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ public void send(Event event) {
boolean notSerializable = e.getCause() instanceof NotSerializableException;

Integer responseCode = e.getResponseCode();
if (notSerializable || (responseCode != null && responseCode != HttpConnection.HTTP_TOO_MANY_REQUESTS)) {
if (notSerializable || (responseCode != null)) {
// don't retry events (discard from the buffer) if:
// 1. they aren't serializable
// 2. the connection is up (valid response code was returned) and it's not an HTTP 429
// 2. the connection is up (valid response code was returned)
buffer.discard(event);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,15 @@ public void test500NotBuffered() throws Exception {
}

@Test
public void test429IsBuffered() throws Exception {
public void test429IsNotBuffered() throws Exception {
Event event = new EventBuilder().build();
connectionException = new ConnectionException("429", new IOException(), null, HttpConnection.HTTP_TOO_MANY_REQUESTS);
try {
bufferedConnection.send(event);
} catch (Exception e) {

}
assertThat(bufferedEvents.size(), equalTo(1));
assertThat(bufferedEvents.size(), equalTo(0));
}

@Test
Expand Down