Place the cubed potatoes in a pot of salted water and cook until soft, roughly 15 to 20 minutes, then drain and allow them to cool slightly.
Mash the cooled potatoes thoroughly until smooth, then mix in the egg and salt until well combined.
Slowly add the flour to the potato mixture, stirring until the dough is soft but not sticky; add a little extra flour if needed without overmixing.
Dust a clean surface lightly with flour and divide the dough into four equal parts.
Roll each part into a rope about 2 centimeters thick, then cut into 2.5 centimeter pieces to form the dumplings.
Bring a large pot of salted water to a boil, carefully drop in the dumplings in batches.
Once the dumplings float to the top, cook for an additional 2 minutes, then remove with a slotted spoon and keep aside.
In a skillet over medium heat, warm the olive oil and butter until melted and hot.
Add the finely chopped onion and cook for about 3 minutes until softened, then stir in the minced garlic and cook for 30 seconds more.
Add the sliced mushrooms to the skillet and sauté until they release their juices and turn golden, about 5 to 7 minutes.
Pour in the vegetable broth and sprinkle in the thyme, letting the mixture simmer gently for 5 minutes.
Stir in the heavy cream or sour cream, season with salt and pepper, and simmer for a further 2 minutes until the sauce slightly thickens.
Toss the cooked dumplings into the mushroom sauce and stir gently to coat, cooking together for 2 to 3 minutes until heated through.
Sprinkle with fresh parsley and optionally grated Parmesan cheese before serving warm.