Hey fediverse--

I recently made the switch from desktop Chrome to desktop #Firefox, which has mostly been fine, except for one problem:

Firefox stops bothering to answer AJAX requests in tabs pretty quickly, which makes my preferred webmail client--#Roundcube--FAR less functional under FF than it was under Chrome.

If left alone for a moment--or sometimes, even while typing an email--FF stops paying attention, further AJAX calls fail, and I'm forced to refresh the tab.

Anybody have any ideas?

belated note: I'm running Firefox on Ubuntu 26.04, using the default snap. (Pic related.)

I don't think the problem is localized there, though, because when I went a-web-searchin' I saw MANY similar complaints about Ajax and FF dating back nearly 20 years.

On a suggestion from someone who says they have no issues with Roundcube under Debian FF ESR, I tried installing from Mozilla's Apt repository.

No obvious change, sadly. Still gets stuck on "refreshing" and fails to update.

@jimsalter I would look in the web inspector and see what happens when it tries to make that request. It will show an error that may or may not be useful. I suspect that their auto refresh mechanism first calls some kind of analytics request first, and Firefox is blocking that for tracking protection.
@nyquildotorg these are the warnings I'm seeing. Not seeing anything labeled an "error."

@nyquildotorg it just took upwards of 30 seconds to complete one of those "Refreshing..." loops. No additional warnings appeared.

I've never seen it take longer than MAYBE 500ms in Chrome. Usually, more like 50ms, barely enough to spot before it's done.

@jimsalter can you switch to the Network tab and then reload the page? What I'm talking about is an error returned by a request, not logged to console
@jimsalter sure it's not server side? How did you determine it was ajax related?

@oemb1905 it's not server side because it's the same server, same network path, and same workstation on the client side as well. Literally the only change is the browser.

If you've got some other answer than ajax I'm listening, but to the best of my understanding ajax is the way RC keeps a live two-way connection going WITH the server.

What am I missing?

@jimsalter I had an issue only with one account, which was an email address that gets thousands per day (for fail2ban reports). All other accounts worked flawlessly under Firefox, including the PWA extension. For that one, though, I had to beef up dovecot in 10-master.conf as follows:

service imap {
vsz_limit = 4096M
process_limit = 2048
}

Then, similarly in /etc/dovecot/conf.d/20-imap.conf, I had to add/replace:

protocol imap {
imap_max_line_length = 256k
mail_max_userip_connections = 50
imap_idle_notify_interval = 15s
}

This fixed the red bar you get where it says fail to connect. Once that was gone, I can leave the tab (or PWA) open indefinitely and mail just comes in no issue. I only use Firefox for checking Roundcube. My full email server setup is here:

https://wiki.haacksnetworking.org/doku.php?id=computing:mailserver-trixie

Keep me posted and hope you get it sorted. But yeah, I'm kind of neurotic about email so I would certainly notice if it failed to refresh, provide alerts, or function - can't recreate here, but I certainly trust that you are not getting the same results ;(

computing:mailserver-trixie [Haack's Wiki]

@oemb1905 that's interesting, but I don't see how dovecot can be the issue, when the issue happens in one browser but not another (and also not with Thunderbird, which isn't even doing the imap calls *locally* like RC is in this case).
@jimsalter Just sharing the only issue I had as per your inquiry about other areas you might consider besides AJAX, not necessarily implying it's your issue per se, but it was my only issue. Likewise sharing that, under this setup, I'm unable to replicate the refresh issue using the same/similar browser. Sure hope you get it sorted🤞
@jimsalter But/and, I would still certainly check dovecot in these areas and would argue that there is inter-relation with AJAX here. Specifically, the vsz_limit and process_limit help dovecot allocate more memory and processes, which helps dovecot handly frequent AJAX requests for messages, searches, refreshing, etc. Additionally, the imap_max_line_length will help AJAX request for large emails/folders, mail_max_userip_connections helps ensure you can maintain simo requests (including AJAX requests). Lastly, the imap_idle_notify_interval specifically ensures quick back and forth (15 s vs. 2 min) for refresh specifically and ensures it is unlikely you get a timeout. I think this last one could be the culprit upon reflection.
@jimsalter https://content.haacksnetworking.org/w/qC2L94PaECSE3Din8TErJP - here I used both the PWA and regular Fox, it did at least refresh no issue and updated. Am I tracking the correct problem?
Firefox-ESR and Firefox-ESR w/ PWA

PeerTube
@jimsalter I agree with the suggestion to leave the DevTools network tab open and look for failed requests after the fact.
@jimsalter I run roundcube regularly and have not experienced any issues. Using firefox-esr Debian.

@oemb1905 thank you VERY much for that data point.

When I get a minute, I'll try installing the .deb version and see if it behaves better!

@oemb1905 just installed FF from Mozilla's own apt repository... which I was pleased and VERY surprised to discover actually overrode the snap, without me having to sort out which identical FF icon went to the snap version and which went to the newly installed version (which happens if you dpkg -i the raw deb, or install from tarball).

I'll update tomorrow whether this solves the problem or not; I should CERTAINLY know by then.

(Any interested onlookers, feel free to poke me if I forget.)

@oemb1905 @jimsalter
I’d second this one. It may be inherently the actual browser, but the extra layer of the sandbox, its rules, and how it’s managed says you won’t be sure until you are out of the Snap-in-the-Box.
Then I’d be curious to see if it would have a problem in a vm.

@jimsalter

Maybe use a tab suspender extension and whitelist that site?

@jimsalter

If that doesn't work, try setting browser.tabs.unloadOnLowMemory to false.

...in "about:config"

@rl_dane boy howdy, that would be some STUPID "optimization" if that's the issue...

Not that I haven't seen VERY stupid memory-related "optimizations" over and over and OVER again on nearly all platforms.

me@elden:~$ free -m
total used free
Mem: 62790 8174 50376

@jimsalter @rl_dane that's a real flex these days...
@jimsalter I have no idea how to solves this. Although, it explains a lot of weird inconsistencies I experienced. Like losing auctions because things didn't refresh. I'd be interested in a solution as well.
@jimsalter Is FF failing to do the JavaScript "promises"? Anything useful in the JavaScript console under web developer tools?