chylex / Discord-History-Tracker

Desktop app & browser script that saves Discord chat history into a file, and an offline viewer that displays the file.
https://dht.chylex.com
MIT License
464 stars 81 forks source link

The selected channel is not visible in the channel list. #219

Closed clort81 closed 11 months ago

clort81 commented 1 year ago

DHT v.31e Firefox-esr 115.1.0esr (64-bit) Installed by pasting the code of track.user.js of v.31e into tampermonkey editor.

Possibly related to disabled telemetry in firefox about:config?

Console error:

NS_ERROR_NOT_IMPLEMENTED: Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIAppStartup.secondsSinceLastOSRestart]
    _collectStartupConditionsTelemetry resource:///modules/BrowserGlue.sys.mjs:1609
    BG__onFirstWindowLoaded resource:///modules/BrowserGlue.sys.mjs:1717
    BG_observe resource:///modules/BrowserGlue.sys.mjs:962
    _delayedStartup chrome://browser/content/browser.js:2051
[BrowserGlue.sys.mjs:1618:15](resource:///modules/BrowserGlue.sys.mjs)
SearchUtils: loadListener: request failed! [SearchUtils.sys.mjs:74:23](resource://gre/modules/SearchUtils.sys.mjs)
SearchEngine: iconLoadCallback: load failed [SearchEngine.sys.mjs:770:29](resource://gre/modules/SearchEngine.sys.mjs)
update.locale  file doesn't exist in either the application or GRE directories

Telemetry related FF config: telemetry_disabled

Possibly related to (?):

 var getMessageElementProps = function(ele) {
    const props = getReactProps(ele);

    if (props.children && props.children.length) {
      for (let i = 3; i < props.children.length; i++) {
        const childProps = props.children[i].props;

        if (childProps && "message" in childProps && "channel" in childProps) {
          return childProps;
        }
      }
    }
chylex commented 1 year ago

Works for me with Firefox + Tampermonkey, but I'm using a different version of Firefox so not sure if they changed something in the ESR. I don't see anything in the logs and don't know why it would be affected by telemetry settings, but I can't reproduce the issue.

vr-marco commented 1 year ago

I get exactly the same when selecting a private threads channel. I tracked it down to DISCORD.getSelectedChannel() returning null. Checked by adding its output to the error message below.

STATE.onStateChanged((type, enabled) => { if (type === "tracking" && enabled){ let info = DISCORD.getSelectedChannel();

if (info){
  let messages = DISCORD.getMessages();

  if (messages != null){
    STATE.addDiscordChannel(info.server, info.type, info.id, info.channel, info.extra);
    STATE.addDiscordMessages(info.id, messages);
  }
  else{
    stopTrackingDelayed(() => alert("Cannot see any messages."));
    return;
  }
}
else{
  stopTrackingDelayed(() => alert("The selected channel is not visible in the channel list. --> " + DISCORD.getSelectedChannel()));
  return;
}
chylex commented 1 year ago

Can't reproduce with a private thread either.

vr-marco commented 1 year ago

Ok let me try with Firefox. Have been using Chrome for my tests.

vr-marco commented 1 year ago

Nope, doesn't work even with Firefox.

UPDATE: by going into the thread and opening the thread tiles one by one, then pressing Start Tracking, actually makes it work. But it is a lot of manual effort.

image
chylex commented 1 year ago

Then you need to clarify you're talking about forum threads, not the other type of threads that existed before forums. Automatically tracking entire forums is not supported, having to open each forum thread individually works as expected.

chylex commented 11 months ago

A recent Discord update will require the browser-only version to be fixed anyway, so I will consider this issue obsolete. Once the browser-only version is fixed, if this issue still happens, you will need to provide more information.