Skip to content

Commit

Permalink
fix: auto dismiss when manual rescan is enabled (#51)
Browse files Browse the repository at this point in the history
* fix: auto dismiss when manual rescan is enabled

now if you reschedule a bunch of events outside of the app it will auto
dismiss them "onAppResume" if they are far enough in the future even with manual
rescan enabled

its unclear why this was disabled in this state in the first place

* build: hopefully fix build
  • Loading branch information
williscool authored Jan 30, 2025
1 parent aa5e1b4 commit ec51fe9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ android {
abortOnError false
}
}

customDebugType {
initWith debug
matchingFallbacks = ['debug']
debuggable true
}
}

sourceSets {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,8 @@ object ApplicationController : EventMovedHandler {
): Boolean {
var ret = false

DevLog.info(LOG_TAG, "Event ${eventId} - checking if should auto remove, oldStartTime $oldStartTime, newStartTime $newStartTime, newAlertTime $newAlertTime, ")

if (newStartTime - oldStartTime > Consts.EVENT_MOVE_THRESHOLD) {
if (newAlertTime > System.currentTimeMillis() + Consts.ALARM_THRESHOLD) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ object CalendarReloadManager : CalendarReloadManagerInterface {
try {
val reloadResult = reloadCalendarEventAlert(context, calendar, event, currentTime, movedHandler)

DevLog.debug(LOG_TAG, "reloadCalendarInternal: Event ${event.eventId} - reloadResult.code ${reloadResult.code} ")

when (reloadResult.code) {
// nothing required
ReloadCalendarResultCode.NoChange ->
Expand Down Expand Up @@ -154,8 +156,7 @@ object CalendarReloadManager : CalendarReloadManagerInterface {
calendar: CalendarProviderInterface,
movedHandler: EventMovedHandler?
): Boolean {
// don't rescan manually created requests - we won't find most of them
val events = db.events.filter { event -> event.origin != EventOrigin.FullManual && event.isNotSpecial }
val events = db.events.filter { event -> event.isNotSpecial }
return reloadCalendarInternal(context, db, events, calendar, movedHandler)
}

Expand Down Expand Up @@ -376,4 +377,4 @@ object CalendarReloadManager : CalendarReloadManagerInterface {

return ReloadCalendarResult(ReloadCalendarResultCode.NoChange, event)
}
}
}

0 comments on commit ec51fe9

Please sign in to comment.