Skip to content

perf(user_status): skip heartbeats another tab already sent - #64137

Merged
artonge merged 1 commit into
masterfrom
perf/noid/user-status-heartbeat-load
Sep 10, 2026
Merged

perf(user_status): skip heartbeats another tab already sent#64137
artonge merged 1 commit into
masterfrom
perf/noid/user-status-heartbeat-load

Conversation

@pringelmann

@pringelmann pringelmann commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Every tab and every page load announced presence on its own, so the dashboard sent two heartbeats (it mounts two instances) and hopping between apps sent one per page.

They now share a lastHeartbeat timestamp in browser storage and send at most one announcement per four minutes, well inside the server's fifteen minute staleness threshold. A tab opened in the background waits until it's actually looked at.

The five minute interval is longer than the four minute window, so a single tab keeps its existing cadence and the gap to the server never grows. Coming back from away is never throttled.

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests (unit, integration, api and/or acceptance) are included
  • Screenshots before/after for front-end changes: no visual change
  • Documentation (manuals or wiki) has been updated or is not required
  • Backports requested where applicable (ex: critical bugfixes)
  • Labels added where applicable (ex: bug/enhancement, 3. to review, feature component)
  • Milestone added for target branch/version (ex: 32.x for stable32)

AI (if applicable)

  • The content of this PR was partly or fully generated using AI (tests, reviewed)

Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
@pringelmann pringelmann added this to the Nextcloud 36 milestone Sep 9, 2026
@pringelmann pringelmann self-assigned this Sep 9, 2026
@pringelmann
pringelmann requested a review from a team as a code owner September 9, 2026 08:29
@pringelmann
pringelmann removed the request for review from a team September 9, 2026 08:29
@pringelmann

Copy link
Copy Markdown
Contributor Author

/backport to stable35

Comment thread apps/user_status/src/services/heartbeatScheduler.ts
@artonge
artonge merged commit d34d1fe into master Sep 10, 2026
147 of 162 checks passed
@artonge
artonge deleted the perf/noid/user-status-heartbeat-load branch September 10, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants