- 
                Notifications
    You must be signed in to change notification settings 
- Fork 208
Added DeliveryStrategy to event delivery #2312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Conversation
| Android notifier sizes
 Generated by 🚫 Danger | 
cfff60b    to
    f3befb5      
    Compare
  
            
          
                bugsnag-android-core/src/main/java/com/bugsnag/android/Event.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                bugsnag-android-core/src/main/java/com/bugsnag/android/DeliveryDelegate.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
      0196aaf    to
    c9adb65      
    Compare
  
    c9adb65    to
    aede41d      
    Compare
  
            
          
                bugsnag-android-core/src/main/java/com/bugsnag/android/Event.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                bugsnag-android-core/src/main/java/com/bugsnag/android/Event.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
      04fb4e9    to
    1cd1c36      
    Compare
  
    1cd1c36    to
    fae2f5b      
    Compare
  
            
          
                bugsnag-android-core/src/main/java/com/bugsnag/android/DeliveryDelegate.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                bugsnag-android-core/src/main/java/com/bugsnag/android/Event.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                bugsnag-android-core/src/test/java/com/bugsnag/android/EventDeliveryStrategyTest.kt
          
            Show resolved
            Hide resolved
        
              
          
                bugsnag-android-core/src/test/java/com/bugsnag/android/EventDeliveryStrategyTest.kt
          
            Show resolved
            Hide resolved
        
              
          
                bugsnag-android-core/src/test/java/com/bugsnag/android/EventDeliveryStrategyTest.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                bugsnag-android-core/src/test/java/com/bugsnag/android/EventDeliveryStrategyTest.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | event.session = | ||
| Session("123", Date(), User(null, null, null), false, notifier, NoopLogger, apiKey) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: formatting
        
          
                bugsnag-android-core/src/test/java/com/bugsnag/android/DeliveryDelegateTest.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                bugsnag-android-core/src/main/java/com/bugsnag/android/internal/ImmutableConfig.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
      d28b8e6    to
    63a16c1      
    Compare
  
            
          
                bugsnag-android-core/src/main/java/com/bugsnag/android/Event.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                bugsnag-android-core/src/test/java/com/bugsnag/android/EventDeliveryStrategyTest.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                bugsnag-android-core/src/test/java/com/bugsnag/android/EventDeliveryStrategyTest.kt
          
            Show resolved
            Hide resolved
        
              
          
                bugsnag-android-core/src/test/java/com/bugsnag/android/EventDeliveryStrategyTest.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
      63a16c1    to
    662cb33      
    Compare
  
    3ba6054    to
    3410976      
    Compare
  
    3410976    to
    02bfa1d      
    Compare
  
    | return impl.getDeliveryStrategy(); | ||
| } | ||
|  | ||
| if (getImpl().getOriginalUnhandled()) { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (getImpl().getOriginalUnhandled()) { | |
| if (impl.getOriginalUnhandled()) { | 
| } | ||
|  | ||
| if (getImpl().getOriginalUnhandled()) { | ||
| String severityReasonType = getImpl().getSeverityReasonType(); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| String severityReasonType = getImpl().getSeverityReasonType(); | |
| String severityReasonType = impl.getSeverityReasonType(); | 
| if (getImpl().getOriginalUnhandled()) { | ||
| String severityReasonType = getImpl().getSeverityReasonType(); | ||
| boolean promiseRejection = REASON_PROMISE_REJECTION.equals(severityReasonType); | ||
| boolean anr = getImpl().isAnr(this); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| boolean anr = getImpl().isAnr(this); | |
| boolean anr = impl.isAnr(this); | 
| boolean anr = getImpl().isAnr(this); | ||
| if (anr || promiseRejection) { | ||
| return DeliveryStrategy.STORE_AND_FLUSH; | ||
| } else if (getImpl().isAttemptDeliveryOnCrash()) { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } else if (getImpl().isAttemptDeliveryOnCrash()) { | |
| } else if (impl.isAttemptDeliveryOnCrash()) { | 
| private val event = Event( | ||
| RuntimeException("Whoops!"), config, | ||
| SeverityReason.newInstance( | ||
| SeverityReason.REASON_UNHANDLED_EXCEPTION | ||
| ), | ||
| NoopLogger | ||
| ) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that this is only used in testGenerateUnhandledReport it should be moved there
| private val apiKey = "BUGSNAG_API_KEY" | ||
| private val notifier = Notifier() | ||
| private val config = generateImmutableConfig() | ||
| private var testException: RuntimeException? = null | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could reasonably be lateinit var instead of being nullable? Alternatively it could be replaced with fun createTestException()
Goal
Introduced
DeliveryStrategytoEventChangeset
Changing the
Event.deliveryStrategywill alter how Bugsnag attempts to deliver theEventindependent of theunhandledstatus.Testing
Updated existing tests