Apple's completely vertical stack means that their machines never have issues sleeping. The huge variety of machines that Linux (and Windows) is expected to run on can cause problems entering S-states reliably. This issue is pretty uncommon (excluding the Windows modern sleep disaster), but that doesn't prevent comments like the GP throwaway.
This is a real issue with Linux. If you want the latest hardware, expect basic features like suspend resume not to work.
You can generally spot this immediately, even without reading the code, by the way it's described as a "workaround".
There's a litany of bugs in Apple's software. This often gets hidden because developers use workarounds of various sorts, but if you know, you know. It's honestly embarrassing how buggy Apple software is given the vertical integration you describe.
The worst part is that almost all of it is closed source so it's harder to debug, and the bits that are open source (and have bugs in plain sight) you can't just submit a patch to. You have to file an rdar and hope it gets prioritized, which for one of the bugs I'm aware of hasn't been in many years. And so the workarounds keep getting written.
Personally, the only problems I've only ever had getting macos to sleep properly has been when I've been running VMs. (Hello docker!)
When doing purely OS-local development (which is all I ever do these days, because I value my sanity) macos works great. (So long as you have a recent mac. New macos + old laptop is awful.)
But as nice as macos is, XCode is an absolute mess. Earlier today I was trying to import a swift package into xcode. The package looked fine, but XCode for some reason was only importing it as a "Folder Reference". Stackoverflow suggested quitting xcode and running "xcodebuild -resolvePackageDependencies", then relaunching xcode. And that fixed it! Why was that necessary? Why couldn't xcode figure that out on its own? What did that even do?? I have no idea. And I hate it.
These days developing in apple's ecosystem feels less like developing in a walled garden and more like developing in a swamp. They're truly lovely developer machines - just so long as you can stay away from xcode.
The actual worst part is that it is impossible to draw a meaningful conclusion from a problem report like this one:
> Mine also shines from the holes when closed. M1 Air. Noticed happens when browser is open and i closed the lid.
Yeah, it shines from the holes. Also develops a halo. Sometimes two. Maybe three, dunno. Sometimes the laptop can see stars.
Yes, it can be indeed an OS related problem as it is not bug free. Or, it could be a faulty laptop specimen, or – most likely – the user has installed something on their laptop that meddles with the sleep routine activation. For instance, OS X has a power nap feature that allows the OS to wake up briefly from the slumber, quickly do something (e.g. check mail, syncronise messages etc) and go back into slumbering again. Any application can register with the operating system to be awaken during a power nap.
And this is where the problem occurs. Users install tons of jackshite on their laptops, and that stuff tends to run a myriad of pre- and postinstallation scripts that crap all over the file system, the launch service database, and install user and system wide agents and all sorts of other unthinkable things. Including adding themselves into the power nap wakeup list without having a real need for it. At best, the app can drain the battery, and it usually does. At worst, the app bundles an system level extension that is buggy and crashes the system when invoked. But oftentimes, such nonsense does not yield its slot in the power nap run queue easily, which meddles with the laptop going back into the sleep and results in all sorts of bizarre problems.
Enterprise software is the worst offender. Nearly every. single. one. enterprise app installs (or runs) untold amounts of crap all over the file system, and nearly each app comes nowadays with its own software update daemon that is forcibly installed into the launchd database and runs 24x7, including at the power nap time. Is there a need to run a update daemon 24x7 to check for updates multiple times a day instead adding a crontab entry to wake it up once a day? No. Is there a need to install a «helper» daemon that does nothing but phones home non-stop sending undisclosed, non-consentual telemetry (likely PII too and more)? Absolutely no.
Microsoft Office is a prime example of such an invasive pest with Citrix Workspace being one of the worst offenders I have encountered in a while. Pick apart installation bundles for either and take a look at their respective pre- and postinstall scripts. Faeces that both slap onto a working OS install have to be thoroughly scrubbed off after, and they can only be scrubbed off with a hardened spatula. I really wish all downloadable app installs could be sandboxed by default and contained to their sandboxes without being able to ever break out of them. APFS supports COW snapshots, so perhaps the installer could create a sandbox and give each a private copy of system configuration files and databases that only the app could crap into into an oblivion without having an effect on a wider system installation.*
That being said, it happened on my m1 MacBook a few weeks ago - so seems like Apple is no better ;)