I also thought that this could be related to rate limiting (when there are many mentions, the client fetches many users and might be getting rate-limited by FF), but that's not the case either. There are no browser logs indicating any 429, and turning off rate-limiting doesn't make a change either (plus, I think that Flarum has some measures to prevent this from happening, like fetching user data in bulk)
In fact, it might not be related to any extension other than mentions. Turning off all extensions and clearing cache (or rsyncing, which clears cache and migrates DB) doesn't make the issue disappear either. I don't want to jump into conclusions again, but I think that it is related either to core or to flarum/mentions (maybe PHP 8.1 changed something?).
Just to make this complete, I am going to leave output of PHP Flarum info of known forum that has this issue:
Flarum core 1.3.1
PHP version: 8.1.7
MySQL version: 10.8.3-MariaDB-1:10.8.3+maria~bionic # <--- probably not a database thing, but just a FYI, we updated that too
# Could be some missing/updated extension?
Loaded extensions: Core, date, libxml, openssl, pcre, zlib, filter, hash, json, pcntl, Reflection, SPL, session, standard, sodium, mysqlnd, PDO, xml, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, iconv, exif, mysqli, pdo_mysql, pdo_pgsql, pgsql, Phar, posix, readline, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, zip, Zend OPcache
+-------------------------------+---------+--------+
| Flarum Extensions | | |
+-------------------------------+---------+--------+
| ID | Version | Commit |
+-------------------------------+---------+--------+
| flarum-markdown | v1.3.0 | |
| fof-upload | 1.2.3 | |
| flarum-sticky | v1.3.0 | |
| flarum-tags | v1.3.0 | |
| flarum-suspend | v1.3.1 | |
| xelson-chat | v1.1.5 | |
| webbinaro-gpx-preview | 1.0.0 | |
| v17development-seo | v1.8.0 | |
| the-turk-stickiest | 2.0.3 | |
| the-turk-flamoji | 1.0.4 | |
| sycho-profile-cover | v1.3.1 | |
| rob006-lang-polish | v0.5.24 | |
| nearata-twofactor | v2.0.1 | |
| migratetoflarum-canonical | 1.0.0 | |
| kyrne-whisper | 0.1.4 | |
| justoverclock-hashtag | 1.0.1 | |
| jslirola-login2seeplus | v0.2 | |
| ianm-syndication | 1.2.0 | |
| fof-user-directory | 1.2.3 | |
| fof-user-bio | 1.1.0 | |
| fof-split | 1.0.1 | |
| fof-socialprofile | 1.1.4 | |
| fof-sitemap | 1.0.3 | |
| fof-secure-https | 1.0.1 | |
| fof-reactions | 1.1.0 | |
| fof-profile-image-crop | 1.0.1 | |
| fof-polls | 1.1.0 | |
| fof-pages | 1.0.4 | |
| fof-nightmode | 1.3.2 | |
| fof-moderator-notes | 1.1.0 | |
| fof-merge-discussions | 1.3.0 | |
| fof-formatting | 1.0.2 | |
| fof-discussion-thumbnail | 1.1.0 | |
| fof-default-user-preferences | 1.0.0 | |
| fof-default-group | 1.1.0 | |
| fof-best-answer | 1.2.2 | |
| flarum-subscriptions | v1.3.1 | |
| flarum-statistics | v1.3.0 | |
| flarum-pusher | v1.3.0 | |
| flarum-mentions | v1.3.1 | |
| flarum-lock | v1.3.0 | |
| flarum-lang-swedish | 1.0.1 | |
| flarum-lang-spanish | 1.2.2 | |
| flarum-lang-german | 1.3.0 | |
| flarum-lang-french | v3.7.0 | |
| flarum-lang-english | v1.3.0 | |
| flarum-lang-dutch | v1.0 | |
| flarum-flags | v1.3.0 | |
| flarum-emoji | v1.3.0 | |
| flarum-bbcode | v1.3.0 | |
| datlechin-silent-edit | v0.1.0 | |
| datlechin-signup-button | v0.1.0 | |
| datlechin-scroll-buttons | v1.0.0 | |
| datlechin-keyboard-shortcuts | v0.1.1 | |
| clarkwinkelmann-bookmarks | 1.0.0 | |
| askvortsov-rich-text | v2.1.7 | |
| askvortsov-pwa | v3.1.3 | |
| askvortsov-moderator-warnings | v0.6.1 | |
| askvortsov-categories | v3.0.6 | |
| acpl-mobile-tab | 1.1.0 | |
| sycho-move-posts | v0.1.6 | |
+-------------------------------+---------+--------+
Base URL: https://www.xxx.com
Installation path: /data/host/xxx/app
Queue driver: sync
Mail driver: smtp
Debug mode: off