Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Do not pass schedule munging failure to iOS app - just log it #246

Closed
wants to merge 1 commit into from

Conversation

syoung-smallwisdom
Copy link
Collaborator

This failure doesn’t really tell the partipants anything useful so showing them an alert is less useful then logging it to crashlytics.

This failure doesn’t really tell the partipants anything useful so showing them an alert is less useful then logging it to crashlytics.
if (!adherenceRecordRepo.loadRemoteAdherenceRecords(studyId)) {
updateFailed?.invoke()
}
!adherenceRecordRepo.loadRemoteAdherenceRecords(studyId)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this throws an error, then it is already being logged.

repo.getStudyBurstSchedule(studyId).collect { timelineResource ->
(timelineResource as? ResourceResult.Success)?.data?.let { schedule ->
viewUpdated(schedule.toNative())
} ?: run {
if (timelineResource is ResourceResult.Failed) {
updateFailed?.invoke()
Logger.e("Update of the `StudyBurstSchedule` failed.",
Throwable("Reason Unknown."))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous behavior was to pop an alert to the participant that said: "Error: An error has occurred" which was not particularly helpful. I'm not seeing anywhere that the failure is being logged so just using a general purpose try/catch here.

private val viewUpdate: (NativeScheduledSessionTimelineSlice) -> Unit
) : AbstractNativeTimelineManager(studyId, scheduleMutator) {
) : AbstractNativeTimelineManager(studyId, null) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the TimelineManager used by Open Bridge App, which does not use the schedule mutator. Since I'm proposing that we move the logic for mutating the schedule per participant into BridgeClientKMM, I don't think we want to support the external mutator.

Copy link

Unit Test Results

  50 files    50 suites   38s ⏱️
128 tests 128 ✔️ 0 💤 0
174 runs  174 ✔️ 0 💤 0

Results for commit cff5de9.

@syoung-smallwisdom
Copy link
Collaborator Author

Nvmd. Closing - it's going to take more effort to unravel why this is being passed to the app.

@syoung-smallwisdom syoung-smallwisdom deleted the syoung/log-schedule-failed branch February 22, 2024 02:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant