Fixes InAppNotifications not working due to missing raw message module#398
Fixes InAppNotifications not working due to missing raw message module#398Infinitay wants to merge 1 commit intoQWERTxD:mainfrom
Conversation
|
There seems to be an existing issue where if you refresh Discord the plugin won't send the notifications but they will accumulate still Steps to reproduce and fix:
Console Log (using my version): [AppNotifications] version 1.1.5 has stopped.
[PluginManager] AppNotifications v1.1.5 could not be started. Error: Minified React error #40; visit https://reactjs.org/docs/error-decoder.html?invariant=40 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at t.unmountComponentAtNode
at Object.shutdown (InAppNotifications.plugin.js:539:22) // shutdown() function within instantiating QWERTLib scope
at Object.shutdown (InAppNotifications.plugin.js:557:23)
at plugin.onStop (InAppNotifications.plugin.js:1079:20)
at plugin.stop (0PluginLibrary.plugin.js:3670:53)
at N.stopPlugin (renderer.js:5:29608)
at N.stopAddon (renderer.js:5:28892)
at N.disableAddon (renderer.js:5:7988)
at N.toggleAddon (renderer.js:5:8313)
at N.togglePlugin (renderer.js:5:26140)
at renderer.js:5:92556
at renderer.js:5:124717
at Object.ek
at eY
at
at re
at rt
at
at sL
at eU
at rs
at tk
at tx |
Have you managed to get a workaround or a fix to this yet? Finding mine is producing the same error where the plugin is not sending the notification. |
Unfortunately not. I haven't bothered looking into it because it's a little hard for me because I'm not too familiar with BD and plugins, but maybe I will take a look tomorrow. For now, you can do the following:
|
|
Have you had any chance to see if there's any update on this to try and resolve it? |
Changes
Hooks onto the
s(e)function. I'm not that versed with the BD API, but I looked through the webpack and found that the following filters returned the appropriate function that fixed InAppNotifications for me. I haven't experienced any issues (yet), so I would appreciate it if someone else could also test this just to confirm things are in fact working for everyone.New hook:
Webpack.getModule(Webpack.Filters.byStrings("userId", "channelId", "mentionEveryone", "mentionUsers", "mentionRoles", "suppressEveryone", "suppressRoles"), { searchExports: true });Additional Information
As I said, I'm not too familiar with hooking into functions so I wasn't sure how to make it such that I retrieve the parent function such that
SomethingHereShrugchanges fromisMentioned.isRawMessageMentioned=>isRawMessageMentioned, but I guess this PR works fine too albeit no proper#isRawMessageMentioneddefinition via the parent (if that makes sense).Other potential hits:
Webpack.getModules(Webpack.Filters.byStrings("userId", "channelId", "mentionEveryone", "mentionUsers", "mentionRoles", "suppressEveryone", "suppressRoles"), { searchExports: true });The workaround in #397 works just fine, but I figured I would take a shot at looking into the webpack to see if I can find the hook again after reading the comments mentioning how
isRawMessageMentionedmay have been removed. I thought by calling it directly there would be some performance increase albeit negligible, but it seems like both the workaround and directly calling is essentially the same judging by thelfunction. Nonetheless, again, the performance is probably negligible.