All set alarms disappeared if you make a mistake while creating a new alarm.

102 views
Skip to first unread message

Robbi

unread,
Nov 21, 2022, 11:32:01 AM11/21/22
to Chromium Extensions
I was doing some tests in the devtools console and I noticed another "quite scaring" thing.
(Anyone who has stumbled upon my previous thread will perhaps begin to think that I possess a certain nefarious "gift".)
I was inspecting a page of my extension and in the console I wrote:
await chrome.alarms.getAll()
The result I got is rightly the array with all the alarms set in the past (in my case 3).
Then, by pure coincidence, I wrote:
chrome.alarms.create('foobar', {when: Date.now () - 120000})
Note the minus sign instead of the plus sign.
I immediately noticed the mistake and I thought: "Never mind, probably this alarm was not created". I wish it was like that!
I run chrome.alarms.getAll() againg and with disbelief I see that the 3 alarms created in the past no longer exist. empty array []
I tried version 105 and 109 (Canary) and the result is the same.
I don't know what to say, please tell me I need to take a vacation
Message has been deleted

Robbi

unread,
Nov 21, 2022, 11:47:18 AM11/21/22
to Chromium Extensions, Robbi
I forgot, it only happens with MV3

Jackie Han

unread,
Nov 21, 2022, 1:11:35 PM11/21/22
to Robbi, Chromium Extensions
Can you show your code? I don't see this problem.

Screenshot 2022-11-22 at 02.05.26.png


On Tue, Nov 22, 2022 at 12:40 AM Robbi <rob...@gmail.com> wrote:
I forgot, it only happens with MV3

Il giorno lunedì 21 novembre 2022 alle 17:32:01 UTC+1 Robbi ha scritto:

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/00df7d8c-25a9-40df-b3f2-2d248899d49en%40chromium.org.

Robbi

unread,
Nov 21, 2022, 1:21:47 PM11/21/22
to Chromium Extensions, Jackie Han, Chromium Extensions, Robbi
try it one more time.
For me happens 3 times on four

Jackie Han

unread,
Nov 21, 2022, 1:26:01 PM11/21/22
to Robbi, Chromium Extensions
If you can reproduce, please report a bug.

Robbi

unread,
Nov 21, 2022, 1:27:09 PM11/21/22
to Chromium Extensions, Jackie Han, Chromium Extensions, Robbi
Immagine.png

Robbi

unread,
Nov 21, 2022, 3:08:33 PM11/21/22
to Chromium Extensions, Robbi, Jackie Han, Chromium Extensions
My bad.
It's only my extension with this behaviour because it has been instructed by its developer (myself).
In the onAlarm event handler I have put a "switch case" that tests the name of the triggered alarm.
When it finds an unexpected name, I ran chrome.alarms.clearAll().
So it's normal that everything disappeared 😋
Perhaps it is strange that the 'foobar' alarm, scheduled for 2 minutes in the past, could trigger the onAlarm event
Reply all
Reply to author
Forward
0 new messages