Skip to content

Commit d8c874b

Browse files
authored
Add readme
1 parent b85db43 commit d8c874b

File tree

1 file changed

+68
-1
lines changed

1 file changed

+68
-1
lines changed

Diff for: README.md

+68-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,69 @@
11
# DiscordNotificationDebug
2-
Helps you find what is preventing discord from sending mobile notifications
2+
Are you frustrated by discord's `Push Notification Inactive Timeout` feature seemingly not working as expected? **It might not be Discord's fault after all!**
3+
4+
In my case, the culprit was the `JC-W01UWH` Wii gamepad USB adapter commonly used by Guitar Hero / Clone Hero players. After troubleshooting with other users who were experiencing the same issue, I also found that other gamepad controllers as well as some no-name OEM gaming mice and suspicious unidentified processes were also to blame.
5+
6+
7+
## Usage
8+
1. Head on over to the [Releases tab](https://github.com/xaviergmail/DiscordNotificationDebug/releases) and download the program (or compile it yourself)
9+
2. Run the program and read the on-screen instructions
10+
3. Let go of your mouse and keyboard and watch the output
11+
12+
Example of **correct** output:
13+
```
14+
/ System is not idle!
15+
- System is not idle!
16+
\ System has been idle for 2 seconds.
17+
| System has been idle for 3 seconds.
18+
/ System has been idle for 4 seconds.
19+
- System has been idle for 5 seconds.
20+
\ System has been idle for 6 seconds.
21+
| System has been idle for 7 seconds.
22+
etc
23+
```
24+
25+
Example of **INCORRECT** output:
26+
```
27+
/ System is not idle!
28+
- System is not idle!
29+
\ System is not idle!
30+
| System is not idle!
31+
/ System is not idle!
32+
- System is not idle!
33+
\ System is not idle!
34+
| System is not idle!
35+
```
36+
37+
It is also theoretically possible that a device may be sending periodical phantom inputs rather than constantly producing them.
38+
For example, a device could be generating a single input event every 30 seconds.
39+
Whatever the interval is (if it is lower than the configured idle timeout), discord will never send you mobile push notifications.
40+
41+
Example of **INCORRECT** output (periodical phantom inputs):
42+
```
43+
| System has been idle for 61 seconds.
44+
/ System has been idle for 62 seconds.
45+
- System has been idle for 64 seconds.
46+
\ System has been idle for 65 seconds.
47+
| System has been idle for 66 seconds.
48+
/ System is not idle!
49+
- System is not idle!
50+
\ System has been idle for 2 seconds.
51+
| System has been idle for 3 seconds.
52+
/ System has been idle for 4 seconds.
53+
```
54+
55+
## Background
56+
I initially ran into this issue with the Discord Windows application.
57+
I made the assumption that it used Electron's [powerMonitor API](https://www.electronjs.org/docs/api/power-monitor) or the browser equivalent [window.requestIdleCallback](https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback) and started investigating.
58+
After much digging around, I found that Electron creates an invisible off-screen window to listen to sleep and screen lock events and falls back on chromium to detect an inactivity timeout. On Windows platforms, Chromium's [idle handler](https://chromium.googlesource.com/chromium/src/+/refs/tags/89.0.4343.1/ui/base/idle/idle_win.cc) relies on Win32's [GetLastInputInfo](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getlastinputinfo). After making this discovery and realizing that GetLastInputInfo was never returning the same tick count, I wrote this program to help me identify the source of the phantom inputs.
59+
60+
## Related bug reports that went unnoticed
61+
https://support.discord.com/hc/en-us/community/posts/360051256154-Push-Notification-Inactive-Timeout-no-longer-working
62+
https://support.discord.com/hc/en-us/community/posts/360049313814-MOBILE-PUSH-NOTIFICATIONS-REMOVED-Bring-them-back
63+
https://support.discord.com/hc/en-us/community/posts/360052612473-Will-not-receive-push-notifications-until-desktop-client-is-closed
64+
65+
## Other info
66+
While this solution requires some trial and error by the user's part to find the root cause, it is by far the simplest to implement. After some quick research, I was unable to find any way to reliably determine the source of the input events and it is unknown what kind of events raise the tick count returned by GetLastInputInfo so such an approach may not even be 100% accurate.
67+
68+
## Known faulty devices
69+
Found something that causes phantom inputs? Add it to the [list](https://github.com/xaviergmail/DiscordNotificationDebug/wiki/Known-problematic-devices)!

0 commit comments

Comments
 (0)