You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Log.d(TAG, "getTrialState: Returning NOT_YET_STARTED_AWAITING_INTERNET (no end time, awaiting internet)")
108
+
Log.d(TAG, "getTrialState: Returning NOT_YET_STARTED_AWAITING_INTERNET (no end time, awaiting internet, not confirmed expired)")
106
109
TrialState.NOT_YET_STARTED_AWAITING_INTERNET
107
110
} else {
108
-
Log.d(TAG, "getTrialState: Returning INTERNET_UNAVAILABLE_CANNOT_VERIFY (end time might exist or not awaiting, but no current time)")
111
+
// This path means either trial has started (endTime exists) or it's not awaiting first internet,
112
+
// but we don't have current time to check. Or, endTime is null but we are not awaiting (inconsistent state).
113
+
Log.d(TAG, "getTrialState: Returning INTERNET_UNAVAILABLE_CANNOT_VERIFY (end time might exist or not awaiting, but no current time, not confirmed expired)")
109
114
TrialState.INTERNET_UNAVAILABLE_CANNOT_VERIFY
110
115
}
111
116
}
112
117
118
+
// currentUtcTimeMs is NOT null from this point onwards
113
119
Log.d(TAG, "getTrialState: currentUtcTimeMs is $currentUtcTimeMs. Evaluating state based on time.")
// This is an inconsistent state: trial supposedly started (not awaiting), but no end time.
130
+
// This might happen if saveTrialUtcEndTime failed or was cleared erroneously.
120
131
Log.e(TAG, "CRITICAL INCONSISTENCY: Trial marked as started (not awaiting internet), but no trial end time found. Check save/load logic. Returning INTERNET_UNAVAILABLE_CANNOT_VERIFY.")
132
+
// Cannot confirm active or expired without an end time.
// Fallback for any unhandled scenarios, though ideally all paths should be covered.
132
149
Log.e(TAG, "Unhandled case in getTrialState. isAwaiting: $isAwaitingFirstInternetTime, endTime: $trialUtcEndTime, currentTime: $currentUtcTimeMs. Defaulting to NOT_YET_STARTED_AWAITING_INTERNET.")
0 commit comments