iOS 16.7.2, iOS 17.1.1: navigator.permissions.query permissionStatus inconsistent response

I am developing a web application that uses the camera and microphone. As part of this, I need to ask for camera and microphone permissions and also handle changes in these permissions.

However, a few issues were discovered in Chrome on iPhone and iPad.

The issue I encountered is that, after attaching an onchange event listener to the status obtained from navigator.permissions.query({name: "microphone"}), there was no detected change in permission state even after camera and microphone permissions were granted. However, when I directly executed navigator.permissions.query({name: "microphone"}) in the Safari JavaScript console, it showed a different state value compared to the status object I created. The status object continuously displayed "prompt", while the direct console query showed "granted".

I suspect that the status object is not being updated in real-time with the browser, or there might be a bug since the onchange event was added quite recently (around September 2022, as far as I know).

Is anyone experiencing similar issues, or does anyone know how to resolve this problem?

Below is a list of the devices I have tested with.

iPhone:

     iPhone 13
     iOS 16.7.2 (maybe safari version is same)

    agent 
         AppleWebKit 605.1.15
         criOS 119.0.6045.169
         Mobile 15E148
         Safari 604.1

    chrome version
         119.0.6045.169(official build)

iPad:

     iPad Air 4th 
     iOS 17.1.1 (maybe safari version is same)

    agent 
         AppleWebKit 605.1.15
         criOS 119.0.6045.169
         Mobile 15E148
         Safari 604.1

    chrome version
         119.0.6045.169(official build)
iOS 16.7.2, iOS 17.1.1: navigator.permissions.query permissionStatus inconsistent response
 
 
Q