From 9374260c59fd72f30bbfcb7aad0f40223c1cf26b Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 20 Mar 2019 15:07:04 -0700 Subject: [PATCH] try to address one-time assert and remove it from shipping build --- .../java/org/eehouse/android/xw4/RelayService.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/RelayService.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/RelayService.java index 2879137d4..8fdffe282 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/RelayService.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/RelayService.java @@ -618,7 +618,12 @@ public class RelayService extends XWJIService iter.hasNext(); ) { PacketData packet = iter.next(); long sentMS = packet.getSentMS(); - Assert.assertTrue( prevSentMS <= sentMS ); + if ( prevSentMS > sentMS ) { + Log.e( TAG, "error: prevSentMS: %d > sentMS: %d", prevSentMS, sentMS ); + Assert.assertFalse( BuildConfig.DEBUG ); + continue; + } + prevSentMS = sentMS; if ( sentMS > minSentMS ) { break; @@ -715,8 +720,7 @@ public class RelayService extends XWJIService udpSocket.send( udpPacket ); sentLen += udpPacket.getLength(); - // Why's this commented out? - // packet.setSentMS( nowMS ); + packet.setSentMS(); // this was commented out. Why? breakNow = false; } catch ( IOException ex ) { Log.e( TAG, "fail sending to %s", udpSocket );