-
-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TwitchDropsMiner joined streams much later, some time after the streams had already started #570
Comments
Apologies again if this is already a known issue or if others have already written about this issue! I couldn't find a whole lot on the issue directly myself that came up for me, so I thought I'd make this issue ticket myself in case anyone else hasn't already :) |
Twitch used to pre-announce upcoming campaigns before they start, and there's leftover logic in the miner that'd handle a case like that more efficiently. However, they've stopped doing that about a year ago or so (I've found a mention of it stopping working on 28th of October 2023). Now, we're relying on the miner's maintenance task doing a reload about once every hour, that re-fetches the list of campaigns and checks if something can be watched now. The nature of doing this means it may miss up to ~60 minutes off the start of a campaign, especially if a reload happens right before the campaign starts. Besides chasing the new campaign appearing and starting, the miner also needs to find a live channel to watch. This is also done during the reload process, by fetching a list of valid live channels with drops enabled. However, this also has a chance of not working, if no live channels happens to exist at the time the reload happens. Picture this situation - a reload happens, the miner discovers a new campaign that has already started 23 minutes ago, fetches a list of live channels but finds none, so it switches to idle for the next 60 minutes. 4 minutes after the reload, a single channel goes online, and can be used to progress the new campaign, but the miner has already missed it and switched to idle, so it's not going to do anything, until another reload happens 60 minutes after the first. There isn't really a good way to handle short campaigns with infrequently available channels. There's no fix for this either, as it'd require refreshing the inventory more often than once every hour, and that'd require a rewrite of the maintenance task at the very least. The best you can do, if you know that a campaign and a live channel are available, is to manually reload the miner by using the button on the Settings tab. The miner works the best when a live channel for a campaign already exists at the time of the reload, so it's best suited for longer campaigns with many possible channels to watch. |
This problem can also be applied for ongoing campaigns, There's 2 drops, the first one having a higher priority (ending today) and only 1 channel, and other with lower priority (ending in a week) with multiple channels. If the first drop channel is not active the second one will be chosen, but if in the middle of the stream the first channel start streaming, the farmer will wait until the current drop is finished to change stream, if the first channel is doing a short stream or the second drop is long the first drop could be missed. Maybe if you're in time priority mode and the current mining drop is not at the top priority the script could check channel availability for higher priority drops every 15-30 min to avoid missing them |
That's not how it works, or at least not how it's supposed to work. Detecting a situation like this is relatively easy, and the existing logic should already handle it. At the end of the reload process, the miner iterates over the existing channels list, determining if any channel can be watched and should be switched to: Lines 840 to 853 in 66c3611
Lines 1005 to 1020 in 66c3611
|
There isn't really a good and efficient way of solving this. The miner assumes that a campaign won't appear just before the stream starts, and even if so, it'll last longer than an hour or two. This has been happening since Twitch has removed the ability to see upcoming campaigns. There was a "partial reload" flow being discussed under one of the already-closed past issues, that could help reduce the possibility of missing very short campaigns. However, the shorter a campaign is, the more often Twitch would need to be queried, and at doing so too often may and will annoy Twitch eventually. Getting down to 15-20 minutes per partial reload shouldn't be too much of a problem though. A partial reload functionality would require quite a substantial rewrite of the existing reload flow though, so this may be more suited for #220. |
@liveuser1 Your case looks like something entirely different - no issue with channel existence for tracking is there. Instead, it looks like the channel went ONLINE, but in a state that was invalid for the miner to switch to it (either There's two systems designed to detect channel changes, both relying on the websocket connection. One of them listens for a "channel goes OFFLINE/ONLINE" change, and the other listens for "channel changed it's settings" event. Both use the I've taken a quick look at it, and it surprisingly looks like there's not much logic for a case where a channel goes from ONLINE to ONLINE (stays ONLINE), but has been updated in some other way (including game changes, and the "drops enabled" flag): Lines 1139 to 1144 in 2c5f56b
This very well qualifies it as a bug. Running a git blame points towards a commit made on 13th of December 2022, over two years ago by now, in which this bug was introduced: b6bc2e1 The 651d73a commit fixes (or at least should fix) this issue. The original problem this issue describes still remains here. |
@liveuser1 Please make sure you're using the latest version of the miner, a long-present bug has been fixed 9 days ago, that could cause exactly the issues you're describing: 651d73a |
Going by his screenshots he is running commit 651d73a (which is the last commit so far) at least going by the title bar of TDM. |
I have latest build 651d73a, with corrections you made after my previous report 9 days ago. It did not fix the issue. To troubleshoot it would be nice to add log records like "new campaign .. detected, dates are..", "drops ... claimed for campaign ..", "drops enabled (disabled) on channel .. (after channel status check)", maybe save gql response if drops are not enabled on channel with active campaign. |
There's currently no way to detect new campaigns, the whole inventory is thrown away and replaced with new inventory on every reload. Unless you want to get 50+ messages about detected campaigns, I think it's not a good idea to add that. Drops being claimed are also not happening, since that's not been a thing since Twitch removed the Lines 1140 to 1144 in 651d73a
If they were enabled, then the current method of detecting if drops are enabled or not is faulty, and there's no other way to detect this, so this isn't fixable. No amount of saving GQL responses will help here. If the current method doesn't work, I see nothing I can do here to help it. |
How and why this is happening? I mean, campaign is active, campaign have only one eligible channel, this channel been streaming during this campaign with drops enabled. And now it start streaming again and drop disabled on channel? Is it something streamer control or twitch? Is it possible twitch enables drops in more than 30s after stream start - maybe making bigger delay before stream status check will help? Maybe make this delay a configurable option. |
This piece of code is responsible for checking for the Lines 273 to 286 in 651d73a
You're right about the flag state being altered after stream start - Twitch doesn't seem to include it's status change in the channel status update event. The event handler runs every time a new stream information is fetched, including when game, title and tags are changed. Note that since the Normally people don't disable the flag though, so this is quite an over-exaggerated scenario. They'd need to have a reason to keep toggling it constantly. I could increase the delay back to the 2 minutes it was before 06d495c. I see no point in making it a configurable option, I decreased it hoping that full 2 minutes aren't needed to start mining on a channel once it gets online, but it looks like it actually matters a little. I'll just bring it back to the 2 minutes it was before. EDIT: The commit was reverted: 1cd408f |
Hi there! I'm new to having a GitHub account and stuff, so apologies if this is already a known thing that someone has written about. I noticed that with the app, with some Warframe Twitch streams that were today(they weren't set as "campaigns" on Twitch that involves the campaign section, just typical timed drops from watching streams), I noticed later on today that the miner had joined today's streams much later than they had started up on, causing a lost reward, which threw me off until I checked the time that the app joined the streams. My priority mode was set to "Priority list only", and my only game listed in the list is Warframe. My app was minimized to tray while the streams were running as well. While checking into the issue a bit, I noticed in the Output terminal that it had been outputting messages about there being no active streams, campaigns, or drops to mine for, which made me wonder if that has to do with how often the app is sending in requests to see which streams are available at the time of sending in a request to the Twitch API. I noticed a bit of a variance in frequency in when the app is sending the output messages about there being no currently active stuff as well, so I thought I'd check up here to make sure that there isn't something that's being caused on my end. This issue also happened to my friend as well today, so I suspect that it's less likely to be something on my end, but I could always be wrong, though. I appreciate you having made this awesome app! I'm glad to have an app that doesn't require you to have Twitch open in a tab at all, and the idea of saving bandwidth is always a welcome thing for sure too! I'm just hoping to be able to hopefully fix the issue and stuff :)
The text was updated successfully, but these errors were encountered: