Chrome notifications onButtonClicked not working?

I am creating a chrome extension for a personal project and I am stuck on getting the chrome notification to work. I have created the chrome notification as shown below, and added listeners for both onClicked and onButtonClicked. I added console logs for each of the following:

  • listeners added
  • notification created
  • button clicked
  • notification clicked
    To my understanding, I should see logs for all items listed, but I do not see the button clicked being logged. Here are the codes for both the notification creation and the listener addition.
// Function to create a notification
function createNotification() {
  chrome.notifications.create(
    NOTIFICATION_ID,
    {
      type: "basic",
      title: "Notification",
      message: "Message",
      iconUrl: "icons/air-horn.png",
      buttons: [{ title: "OK" }],
    },
    function () {
      console.log("notification created");
    }
  );
}

// Function to add listener for button clicks
function addNotificationListener() {
  chrome.notifications.onButtonClicked.addListener(function(notificationId) {
    console.log("Button clicked", notificationId);
  });
  chrome.notifications.onClicked.addListener(function (notifica`your text`tionId) {
    console.log("Notification clicked:", notificationId);
  });
  console.log("added");
}

addNotificationListener();

To further clarify, I have verified that my manifest contains the notification permission, and this is running in my background script. I have also referred to the chrome.notifications api but nothing seems to work. Everything else outside the code chunk behaves as expected. The only reference to the code chunk above would be the trigger to create the notification. I also have a runtime message listener but I do not believe that that is the cause of this issue.

I have tried:

  1. adding the listeners to the notification creation.
  2. adding the listeners outside of the function (with just the 2 lines of the addListener() instead of creating a function for them)
  3. testing in incognito
  4. removing a button (initially i started with 2 buttons and now I’m only using one)

All of these resulted in the same outcome below, with only the button clicked message missing.
Dev mode console