Skip to content
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

Fix #1104: Offline Exception Logging #1500

Merged
merged 34 commits into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3a5134a
proto structure.
Sarthak2601 Jul 22, 2020
f1ff8d3
controller.
Sarthak2601 Jul 22, 2020
df0d256
Merge branch 'develop' into exception-log-offline
Sarthak2601 Jul 22, 2020
2059c90
code replacement logger -> controller (Domain)
Sarthak2601 Jul 22, 2020
2f01174
Merge branch 'develop' into exception-log-offline
Sarthak2601 Jul 22, 2020
3b8174d
app module test fixes.
Sarthak2601 Jul 23, 2020
3a745d5
nits | changes | tests.
Sarthak2601 Jul 25, 2020
b4fc381
Merge branch 'develop' into exception-log-offline
Sarthak2601 Jul 25, 2020
cb7424e
lint corrections.
Sarthak2601 Jul 25, 2020
48de325
more lint fixes.
Sarthak2601 Jul 25, 2020
c6b9d73
Merge branch 'develop' into exception-log-offline
Sarthak2601 Jul 25, 2020
d8c09da
fixes.
Sarthak2601 Jul 26, 2020
06c60a5
Merge branch 'develop' into exception-log-offline
Sarthak2601 Jul 26, 2020
36237d8
Merge branch 'develop' into exception-log-offline
Sarthak2601 Jul 27, 2020
8af1f11
nits.
Sarthak2601 Jul 29, 2020
c284d59
nits.
Sarthak2601 Jul 29, 2020
d5698f8
helper class.
Sarthak2601 Jul 30, 2020
34f1b9f
Merge branch 'develop' into exception-log-offline
Sarthak2601 Jul 30, 2020
1e1a758
fixes.
Sarthak2601 Jul 31, 2020
509d306
kdoc.
Sarthak2601 Jul 31, 2020
99d0a23
nit.
Sarthak2601 Aug 4, 2020
07119de
additions.
Sarthak2601 Aug 5, 2020
d3ee04f
lint corrections.
Sarthak2601 Aug 5, 2020
4ce4ebf
Merge branch 'develop' into exception-log-offline
Sarthak2601 Aug 5, 2020
fd1371d
Merge branch 'develop' into exception-log-offline
Sarthak2601 Aug 5, 2020
76b675a
in progress.
Sarthak2601 Aug 6, 2020
713546f
in progress.
Sarthak2601 Aug 9, 2020
a5b1b5a
getExceptionLogStore
Sarthak2601 Aug 10, 2020
9646b51
lint fix.
Sarthak2601 Aug 10, 2020
d31adcc
Merge branch 'develop' into exception-log-offline
Sarthak2601 Aug 10, 2020
50ade6b
fix.
Sarthak2601 Aug 11, 2020
e4cab13
minor fix.
Sarthak2601 Aug 11, 2020
b51f787
lint fix.
Sarthak2601 Aug 11, 2020
cc74a1c
Merge branch 'develop' into exception-log-offline
Sarthak2601 Aug 11, 2020
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 @@ -55,6 +55,7 @@ import org.oppia.app.settings.profile.ProfileListActivity
import org.oppia.app.testing.NavigationDrawerTestActivity
import org.oppia.app.utility.OrientationChangeAction.Companion.orientationLandscape
import org.oppia.app.utility.OrientationChangeAction.Companion.orientationPortrait
import org.oppia.domain.oppialogger.LogStorageModule
import org.oppia.domain.profile.ProfileTestHelper
import org.oppia.testing.TestLogReportingModule
import org.oppia.util.logging.EnableConsoleLog
Expand Down Expand Up @@ -638,7 +639,7 @@ class AdministratorControlsActivityTest {
}

@Singleton
@Component(modules = [TestModule::class, TestLogReportingModule::class])
@Component(modules = [TestModule::class, TestLogReportingModule::class, LogStorageModule::class])
interface TestApplicationComponent {
@Component.Builder
interface Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import org.oppia.app.recyclerview.RecyclerViewMatcher.Companion.atPositionOnView
import org.oppia.app.testing.HomeInjectionActivity
import org.oppia.app.topic.TopicActivity
import org.oppia.app.utility.OrientationChangeAction.Companion.orientationLandscape
import org.oppia.domain.oppialogger.LogStorageModule
import org.oppia.domain.profile.ProfileManagementController
import org.oppia.domain.profile.ProfileTestHelper
import org.oppia.domain.topic.TEST_STORY_ID_0
Expand Down Expand Up @@ -621,7 +622,7 @@ class HomeActivityTest {
}

@Singleton
@Component(modules = [TestModule::class, TestLogReportingModule::class])
@Component(modules = [TestModule::class, TestLogReportingModule::class, LogStorageModule::class])
interface TestApplicationComponent {
@Component.Builder
interface Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import org.oppia.app.recyclerview.RecyclerViewMatcher.Companion.atPositionOnView
import org.oppia.app.recyclerview.RecyclerViewMatcher.Companion.hasGridItemCount
import org.oppia.app.utility.EspressoTestsMatchers.withDrawable
import org.oppia.app.utility.OrientationChangeAction.Companion.orientationLandscape
import org.oppia.domain.oppialogger.LogStorageModule
import org.oppia.domain.profile.ProfileTestHelper
import org.oppia.domain.topic.FRACTIONS_EXPLORATION_ID_0
import org.oppia.domain.topic.FRACTIONS_STORY_ID_0
Expand Down Expand Up @@ -793,7 +794,7 @@ class RecentlyPlayedFragmentTest {
}

@Singleton
@Component(modules = [TestModule::class, TestLogReportingModule::class])
@Component(modules = [TestModule::class, TestLogReportingModule::class, LogStorageModule::class])
interface TestApplicationComponent {
@Component.Builder
interface Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import org.junit.runner.RunWith
import org.oppia.app.R
import org.oppia.app.recyclerview.RecyclerViewMatcher.Companion.atPositionOnView
import org.oppia.app.utility.OrientationChangeAction.Companion.orientationLandscape
import org.oppia.domain.oppialogger.LogStorageModule
import org.oppia.domain.profile.ProfileTestHelper
import org.oppia.testing.TestLogReportingModule
import org.oppia.util.logging.EnableConsoleLog
Expand Down Expand Up @@ -657,7 +658,7 @@ class OptionsFragmentTest {
}

@Singleton
@Component(modules = [TestModule::class, TestLogReportingModule::class])
@Component(modules = [TestModule::class, TestLogReportingModule::class, LogStorageModule::class])
interface TestApplicationComponent {
@Component.Builder
interface Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import org.oppia.app.R
import org.oppia.app.testing.AudioFragmentTestActivity
import org.oppia.app.utility.OrientationChangeAction.Companion.orientationLandscape
import org.oppia.domain.audio.AudioPlayerController
import org.oppia.domain.oppialogger.LogStorageModule
import org.oppia.domain.profile.ProfileTestHelper
import org.oppia.testing.TestLogReportingModule
import org.oppia.util.caching.CacheAssetsLocally
Expand Down Expand Up @@ -414,7 +415,7 @@ class AudioFragmentTest {
}

@Singleton
@Component(modules = [TestModule::class, TestLogReportingModule::class])
@Component(modules = [TestModule::class, TestLogReportingModule::class, LogStorageModule::class])
interface TestApplicationComponent {
@Component.Builder
interface Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ import org.oppia.app.utility.DragViewAction
import org.oppia.app.utility.OrientationChangeAction.Companion.orientationLandscape
import org.oppia.app.utility.RecyclerViewCoordinatesProvider
import org.oppia.app.utility.clickPoint
import org.oppia.domain.oppialogger.LogStorageModule
import org.oppia.domain.profile.ProfileTestHelper
import org.oppia.domain.topic.TEST_EXPLORATION_ID_0
import org.oppia.domain.topic.TEST_EXPLORATION_ID_2
Expand Down Expand Up @@ -1076,7 +1077,7 @@ class StateFragmentTest {
}

@Singleton
@Component(modules = [TestModule::class, TestLogReportingModule::class])
@Component(modules = [TestModule::class, TestLogReportingModule::class, LogStorageModule::class])
interface TestApplicationComponent {
@Component.Builder
interface Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import org.junit.Test
import org.junit.runner.RunWith
import org.oppia.app.R
import org.oppia.app.utility.OrientationChangeAction.Companion.orientationLandscape
import org.oppia.domain.oppialogger.LogStorageModule
import org.oppia.domain.profile.ProfileTestHelper
import org.oppia.testing.TestLogReportingModule
import org.oppia.util.logging.EnableConsoleLog
Expand Down Expand Up @@ -1609,7 +1610,7 @@ class AddProfileActivityTest {
}

@Singleton
@Component(modules = [TestModule::class, TestLogReportingModule::class])
@Component(modules = [TestModule::class, TestLogReportingModule::class, LogStorageModule::class])
interface TestApplicationComponent {
@Component.Builder
interface Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import org.junit.runner.RunWith
import org.oppia.app.R
import org.oppia.app.administratorcontrols.AdministratorControlsActivity
import org.oppia.app.utility.OrientationChangeAction.Companion.orientationLandscape
import org.oppia.domain.oppialogger.LogStorageModule
import org.oppia.domain.profile.ProfileTestHelper
import org.oppia.testing.TestLogReportingModule
import org.oppia.util.logging.EnableConsoleLog
Expand Down Expand Up @@ -801,7 +802,7 @@ class AdminPinActivityTest {
}

@Singleton
@Component(modules = [TestModule::class, TestLogReportingModule::class])
@Component(modules = [TestModule::class, TestLogReportingModule::class, LogStorageModule::class])
interface TestApplicationComponent {
@Component.Builder
interface Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import org.oppia.app.R
import org.oppia.app.home.HomeActivity
import org.oppia.app.utility.EspressoTestsMatchers.withDrawable
import org.oppia.app.utility.OrientationChangeAction.Companion.orientationLandscape
import org.oppia.domain.oppialogger.LogStorageModule
import org.oppia.domain.profile.ProfileTestHelper
import org.oppia.testing.TestLogReportingModule
import org.oppia.util.logging.EnableConsoleLog
Expand Down Expand Up @@ -725,7 +726,7 @@ class PinPasswordActivityTest {
}

@Singleton
@Component(modules = [TestModule::class, TestLogReportingModule::class])
@Component(modules = [TestModule::class, TestLogReportingModule::class, LogStorageModule::class])
interface TestApplicationComponent {
@Component.Builder
interface Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import org.oppia.app.home.HomeActivity
import org.oppia.app.recyclerview.RecyclerViewMatcher.Companion.atPosition
import org.oppia.app.recyclerview.RecyclerViewMatcher.Companion.atPositionOnView
import org.oppia.app.utility.OrientationChangeAction.Companion.orientationLandscape
import org.oppia.domain.oppialogger.LogStorageModule
import org.oppia.domain.profile.ProfileManagementController
import org.oppia.domain.profile.ProfileTestHelper
import org.oppia.testing.TestLogReportingModule
Expand Down Expand Up @@ -698,7 +699,7 @@ class ProfileChooserFragmentTest {
}

@Singleton
@Component(modules = [TestModule::class, TestLogReportingModule::class])
@Component(modules = [TestModule::class, TestLogReportingModule::class, LogStorageModule::class])
interface TestApplicationComponent {
@Component.Builder
interface Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.oppia.app.R
import org.oppia.domain.oppialogger.LogStorageModule
import org.oppia.domain.profile.ProfileTestHelper
import org.oppia.testing.TestLogReportingModule
import org.oppia.util.logging.EnableConsoleLog
Expand Down Expand Up @@ -136,7 +137,7 @@ class ProfilePictureActivityTest {
}

@Singleton
@Component(modules = [TestModule::class, TestLogReportingModule::class])
@Component(modules = [TestModule::class, TestLogReportingModule::class, LogStorageModule::class])
interface TestApplicationComponent {
@Component.Builder
interface Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import org.oppia.app.model.ProfileId
import org.oppia.app.ongoingtopiclist.OngoingTopicListActivity
import org.oppia.app.recyclerview.RecyclerViewMatcher.Companion.atPositionOnView
import org.oppia.app.utility.OrientationChangeAction.Companion.orientationLandscape
import org.oppia.domain.oppialogger.LogStorageModule
import org.oppia.domain.profile.ProfileTestHelper
import org.oppia.domain.topic.StoryProgressTestHelper
import org.oppia.testing.TestLogReportingModule
Expand Down Expand Up @@ -716,7 +717,7 @@ class ProfileProgressFragmentTest {
}

@Singleton
@Component(modules = [TestModule::class, TestLogReportingModule::class])
@Component(modules = [TestModule::class, TestLogReportingModule::class, LogStorageModule::class])
interface TestApplicationComponent {
@Component.Builder
interface Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import org.junit.Test
import org.junit.runner.RunWith
import org.oppia.app.R
import org.oppia.app.utility.OrientationChangeAction.Companion.orientationLandscape
import org.oppia.domain.oppialogger.LogStorageModule
import org.oppia.domain.profile.ProfileManagementController
import org.oppia.domain.profile.ProfileTestHelper
import org.oppia.testing.TestLogReportingModule
Expand Down Expand Up @@ -386,7 +387,7 @@ class ProfileEditActivityTest {
}

@Singleton
@Component(modules = [TestModule::class, TestLogReportingModule::class])
@Component(modules = [TestModule::class, TestLogReportingModule::class, LogStorageModule::class])
interface TestApplicationComponent {
@Component.Builder
interface Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import org.oppia.app.R
import org.oppia.app.recyclerview.RecyclerViewMatcher.Companion.atPosition
import org.oppia.app.recyclerview.RecyclerViewMatcher.Companion.atPositionOnView
import org.oppia.app.utility.OrientationChangeAction.Companion.orientationLandscape
import org.oppia.domain.oppialogger.LogStorageModule
import org.oppia.domain.profile.ProfileTestHelper
import org.oppia.testing.TestLogReportingModule
import org.oppia.util.logging.EnableConsoleLog
Expand Down Expand Up @@ -290,7 +291,7 @@ class ProfileListActivityTest {
}

@Singleton
@Component(modules = [TestModule::class, TestLogReportingModule::class])
@Component(modules = [TestModule::class, TestLogReportingModule::class, LogStorageModule::class])
interface TestApplicationComponent {
@Component.Builder
interface Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import org.junit.Test
import org.junit.runner.RunWith
import org.oppia.app.R
import org.oppia.app.utility.OrientationChangeAction.Companion.orientationLandscape
import org.oppia.domain.oppialogger.LogStorageModule
import org.oppia.domain.profile.ProfileTestHelper
import org.oppia.testing.TestLogReportingModule
import org.oppia.util.logging.EnableConsoleLog
Expand Down Expand Up @@ -358,7 +359,7 @@ class ProfileRenameActivityTest {
}

@Singleton
@Component(modules = [TestModule::class, TestLogReportingModule::class])
@Component(modules = [TestModule::class, TestLogReportingModule::class, LogStorageModule::class])
interface TestApplicationComponent {
@Component.Builder
interface Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import org.junit.Test
import org.junit.runner.RunWith
import org.oppia.app.R
import org.oppia.app.utility.OrientationChangeAction.Companion.orientationLandscape
import org.oppia.domain.oppialogger.LogStorageModule
import org.oppia.domain.profile.ProfileTestHelper
import org.oppia.testing.TestLogReportingModule
import org.oppia.util.logging.EnableConsoleLog
Expand Down Expand Up @@ -749,7 +750,7 @@ class ProfileResetPinActivityTest {
}

@Singleton
@Component(modules = [TestModule::class, TestLogReportingModule::class])
@Component(modules = [TestModule::class, TestLogReportingModule::class, LogStorageModule::class])
interface TestApplicationComponent {
@Component.Builder
interface Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import org.oppia.app.recyclerview.RecyclerViewMatcher.Companion.atPositionOnView
import org.oppia.app.recyclerview.RecyclerViewMatcher.Companion.hasItemCount
import org.oppia.app.testing.StoryFragmentTestActivity
import org.oppia.app.utility.OrientationChangeAction.Companion.orientationLandscape
import org.oppia.domain.oppialogger.LogStorageModule
import org.oppia.domain.profile.ProfileTestHelper
import org.oppia.domain.topic.FRACTIONS_STORY_ID_0
import org.oppia.domain.topic.FRACTIONS_TOPIC_ID
Expand Down Expand Up @@ -366,7 +367,7 @@ class StoryFragmentTest {
}

@Singleton
@Component(modules = [TestModule::class, TestLogReportingModule::class])
@Component(modules = [TestModule::class, TestLogReportingModule::class, LogStorageModule::class])
interface TestApplicationComponent {
@Component.Builder
interface Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import org.oppia.app.mydownloads.MyDownloadsActivity
import org.oppia.app.profile.ProfileActivity
import org.oppia.app.recyclerview.RecyclerViewMatcher.Companion.atPositionOnView
import org.oppia.app.utility.OrientationChangeAction.Companion.orientationLandscape
import org.oppia.domain.oppialogger.LogStorageModule
import org.oppia.domain.profile.ProfileTestHelper
import org.oppia.domain.topic.StoryProgressTestHelper
import org.oppia.testing.TestLogReportingModule
Expand Down Expand Up @@ -568,7 +569,7 @@ class NavigationDrawerTestActivityTest {
}

@Singleton
@Component(modules = [TestModule::class, TestLogReportingModule::class])
@Component(modules = [TestModule::class, TestLogReportingModule::class, LogStorageModule::class])
interface TestApplicationComponent {
@Component.Builder
interface Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import org.oppia.app.topic.TopicActivity
import org.oppia.app.topic.TopicTab
import org.oppia.app.utility.EspressoTestsMatchers.withDrawable
import org.oppia.app.utility.OrientationChangeAction.Companion.orientationLandscape
import org.oppia.domain.oppialogger.LogStorageModule
import org.oppia.domain.profile.ProfileTestHelper
import org.oppia.domain.topic.RATIOS_EXPLORATION_ID_0
import org.oppia.domain.topic.RATIOS_STORY_ID_0
Expand Down Expand Up @@ -592,7 +593,7 @@ class TopicLessonsFragmentTest {
}

@Singleton
@Component(modules = [TestModule::class, TestLogReportingModule::class])
@Component(modules = [TestModule::class, TestLogReportingModule::class, LogStorageModule::class])
interface TestApplicationComponent {
@Component.Builder
interface Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import org.oppia.app.R
import org.oppia.app.model.ProfileId
import org.oppia.app.onboarding.OnboardingActivity
import org.oppia.app.utility.OrientationChangeAction.Companion.orientationLandscape
import org.oppia.domain.oppialogger.LogStorageModule
import org.oppia.domain.profile.ProfileTestHelper
import org.oppia.testing.TestLogReportingModule
import org.oppia.util.logging.EnableConsoleLog
Expand Down Expand Up @@ -178,7 +179,7 @@ class WalkthroughWelcomeFragmentTest {
}

@Singleton
@Component(modules = [TestModule::class, TestLogReportingModule::class])
@Component(modules = [TestModule::class, TestLogReportingModule::class, LogStorageModule::class])
interface TestApplicationComponent {
@Component.Builder
interface Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import org.oppia.domain.oppialogger.exceptions.ExceptionsController
import org.oppia.util.caching.AssetRepository
import org.oppia.util.caching.CacheAssetsLocally
import org.oppia.util.data.AsyncResult
import org.oppia.util.logging.ConsoleLogger
import org.oppia.util.logging.ExceptionLogger
import org.oppia.util.system.OppiaClock
import org.oppia.util.threading.BackgroundDispatcher
import java.io.IOException
import java.util.concurrent.TimeUnit
Expand All @@ -34,7 +35,8 @@ import kotlin.concurrent.withLock
class AudioPlayerController @Inject constructor(
private val logger: ConsoleLogger,
private val assetRepository: AssetRepository,
private val exceptionLogger: ExceptionLogger,
private val exceptionsController: ExceptionsController,
private val oppiaClock: OppiaClock,
@BackgroundDispatcher private val backgroundDispatcher: CoroutineDispatcher,
@CacheAssetsLocally private val cacheAssetsLocally: Boolean
) {
Expand Down Expand Up @@ -183,7 +185,7 @@ class AudioPlayerController @Inject constructor(
}
mediaPlayer.prepareAsync()
} catch (e: IOException) {
exceptionLogger.logException(e)
exceptionsController.logNonFatalException(e, oppiaClock.getCurrentCalendar().timeInMillis)
logger.e("AudioPlayerController", "Failed to set data source for media player", e)
}
playProgress?.value = AsyncResult.pending()
Expand Down
Loading