### Problem:

I have a Whirlpool oven in the US, model WFG540H0ES0 [(photo)](https://i.stack.imgur.com/YotMA.jpg). It's worked fine for the last 3.5 years, but a few weeks ago the oven stopped igniting. When I start the oven in the control panel, the following sequence takes place:

1. I can hear the gas valve open and gas starts flowing out
2. The gas valve closes a second later, stopping the flow of gas
3. Igniter then sparks 4 times, but by that time there is no more gas coming out

Here's [a video that demonstrates the issue](https://www.youtube.com/watch?v=rfa35iuKyjo). I lit a candle next to the vents so you can see gas come out for a split second, but then the gas shuts off before the igniter starts sparking.

### Solutions I've tried:

* Some Youtube videos online suggested I replace the igniter, so [I purchased this replacement online](https://rads.stackoverflow.com/amzn/click/com/B00LHR2A9O) and installed it, but the problem is exactly the same so I know it's not the igniter.
* I tested the thermostat by holding a candle to it. It indicates 100°F when the oven is off, and starts climbing when the flame touches it, so I know it works.
* I've unplugged it from the wall and plugged it back again, to no avail.

I took some photos:

* [Oven igniter](https://i.imgur.com/bbVOSpp.jpg) (Since been replaced with a newer one)
* [Underside where the drawer usually is](https://i.imgur.com/V8yuknd.jpg) (You can see the gas valve leading to the burner tube)
* [Gas valves from behind the oven](https://i.imgur.com/aQdqMLr.jpg) (One pipe leads to the broiler, the other to the stovetop range, which works fine)

### Questions:

1. What is the determining part that tells the gas valve to shut off so I can clean or replace it? I know it must have a sensor that automatically shuts off the gas if a flame is not detected (to prevent flooding the house with gas), but where is this sensor? I've scoured the [parts list here](https://s3.amazonaws.com/sm-backend-production-attachments/09001a508031e6ea/Repair%20Part%20List%20-%20W10796914%20-%20Rev%20A.pdf) but I don't see anything that suggest it's a flame sensor.
2. Does anyone have any solutions to my issue? I already replaced the spark igniter, which didn't work. I'm trying to fix the oven myself because we're in quarantine and don't want to ask a repairman to come into our house.