← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~nik90/ubuntu-clock-app/fix-invalid-alarm-model into lp:ubuntu-clock-app

 

The proposal to merge lp:~nik90/ubuntu-clock-app/fix-invalid-alarm-model into lp:ubuntu-clock-app has been updated.

Description changed to:

This MP fixes the issue where an edited alarm is not saveable after importing a new custom sound from the music app.

Background Info
---------------
We reload the Alarms Model whenever the clock app loses focus. This was done a long time ago to fix the of one-time alarms that rang not appearing off after they were switched off by the user. Reloading the Alarms Model causes the UI to refresh, which thereby then shows the correct alarm switch value.

Current Situation
-----------------
However it turns out that when in the EditAlarmPage, if clock app loses focus due to switching to the music app, the tempAlarm variable loses track of the alarm we were editing since the Alarms Model reloaded. As a result, saving an edited alarm after importing a new custom sound from music-app results in an error that tempAlarm is undefined :-)

Solution
--------
I have made the Alarms Model to reload *only* when in the MainPage or the AlarmsPage (basically when the alarms list is visible in the UI and requires refreshing). This thereby fixes the critical bug for good.

I have also added a manual test to ensure that this bug is never introduced accidentally in future versions of the clock app.

For more details, see:
https://code.launchpad.net/~nik90/ubuntu-clock-app/fix-invalid-alarm-model/+merge/268838
-- 
Your team Ubuntu Clock Developers is requested to review the proposed merge of lp:~nik90/ubuntu-clock-app/fix-invalid-alarm-model into lp:ubuntu-clock-app.


Follow ups