Hi,
I found a behavior which I believe is a bug: an extension reload, update or restart will not delete previously registered alarms.
Scenario:
- Load an extension that sets an alarm (chrome.alarms.create).
- Reload, update or restart the extension. The loaded extension does not create an alarm.
- The reloaded extension adds a listener to the onAlarm event.
- The callback is called with the alarm that was set on step 1.
Looking at the AlarmManager code (src/extensions/browser/api/alarms/alarm_manager.cc), it seems that alarms are removed only if the extension is being uninstalled, however, it does not observe the OnExtensionUnloaded event.
The vast majority of stateful extension APIs observe and respond to the OnExtensionUnloaded event, so the state of these APIs will not be kept across extension updates.
Before I'm opening a bug, I would like to know if this is an intended feature.
Thanks,
Yoav.