Skip to content

invalid offsets are retained when editing an existing alarm's event #530

@forrestguice

Description

@forrestguice

To reproduce:

  1. Open the SuntimesAlarms activity.
  2. Click the Add (+) button. (opens alarm dialog)
  3. Select the summer solstice, then click ok. (transitions to EditActivity)
  4. Click the at button. (opens offset dialog)
  5. Select 2 days and before; note that multi-day offsets are only available for the moon phases and solstices/equinoxes, but are not supported by the daily rising/setting/twilight events. (closes offset dialog)
  6. Click summer solstice. (reopens the alarm dialog)
  7. Change the event to sunrise, then click ok. (closes the alarm dialog)
  8. Click save. (transitions back to the alarm list)

Observe: The alarm is now set for "2 days before sunrise", with the correct time for sunrise, but for a date that 2 days in the future. The offset is invalid for this event (and the scheduling behavior unexpected).

When scheduling the alarm the algorithm repeatedly fails to find "2 days before sunrise", until it has advanced at least that many days. A side-effect is that its actually possible schedule an alarm that "skips every n days" (but that's not intended). The expected behavior is that multi-day offsets are cleared when changing to an event that doesn't support them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions