Hau-Hau / firefox-tab-suspender

A Firefox extension that automatic suspend tabs and saves memory
Other
15 stars 2 forks source link

Automatic Suspension Rules are not working #22

Closed MyrTheMoth closed 4 years ago

MyrTheMoth commented 5 years ago

Firefox 67.0.1 (64-bit) Firefox Tab Suspender 3.4.4

Expected Behavior:

Current Behavior:

I'd be happy to help debug this case, are there any logs or metrics I can pull for your review?

Hau-Hau commented 5 years ago

Hello @DragonFlayer!

Thanks for your post, unfortunately now I don't have any tools to debug. Problems with automatic suspension are from long time and unfortunately I don't have much time lately to debug this problem because this isn't bug that can be quickly solved.

Interesting is that you noticed problems with pinned tabs and tabs which playing sound.

I think there is need to write some tests of C code. I will fix that fast as I can because this is very important bug.

Thanks for your support! Michalewicz Piotr

MyrTheMoth commented 5 years ago

Yeah, on pinned messages, it happens more often on sites that update frequently while the tab is not focused, such as YouTube or Google Drive

SIRprise commented 5 years ago

Here it is the same - it seems to happen more often, if you load a site and switch to another tab during loading. I could switch between the two tabs and every time it was suspended - suspend time was configured to 600.

Hau-Hau commented 5 years ago

Hello!

Today i was released new version of extension (3.4.6). Many parts of code have been rewritten, also those related with automatic suspension. I'm still testing but in my opinion extension works better.

It will be helpful if you guys told me whether you have still problems.

Best regards, Michalewicz Piotr

SIRprise commented 5 years ago

At the moment it seems the tabs are not suspended. Maybe it is useful to know that I often use the suspend mode of my computer. Maybe there is an overflow?

Hmm, I couldn't find the part of code where the event-handler and timer is for suspending etc. It seems to me that there are handler in case of opening/closing/updating tabs. Where is the part which querys the time and where is it compared? Is it translated from C to JS or the other way around?

Hau-Hau commented 4 years ago

Hello,

Yesterday I released new version (3.5.1). I hope problems with automatic suspending were solved for good. I will close this issue for now, if you will still have problems please write comment here then I will reopen issue.

@SIRprise Code isn't translated from C to JS. There are something like two separated environments which are communicating with each other. Take a look at diagram in readme. JS calls C's events (whole C code is event driven). C is putting events in the queue and run every event one by one.

In context of discarding: 1) C calls jsExpiredTabsWatcher via JavaScriptProviderService (javascript_provider_service.c).

2) jsExpiredTabsWatcher is nothing more than interval that if can push event then is pushing discard event to C.

3) Then C runs discardTabs() function (events_service.c), this function check if there is any tab to suspend. If there tabs to suspend then calls jsChromeTabsDiscard via JavaScriptProviderService.

4) chromeTabsDiscard from library.js handles rest of things related with suspending like decolorizing of favicons.

It is a bit complicated, but with this approach tabs watcher doesn't block C code.

Best regards, Michalewicz Piotr