Skip to content

perf(frontend): pause background polling when tab is hidden#13129

Open
hamza221 wants to merge 1 commit into
mainfrom
perf/frontend-polling-debounce
Open

perf(frontend): pause background polling when tab is hidden#13129
hamza221 wants to merge 1 commit into
mainfrom
perf/frontend-polling-debounce

Conversation

@hamza221

Copy link
Copy Markdown
Contributor

Skip the periodic inbox/mailbox/outbox polling while document.hidden is true, and add an in-flight guard to the recursive inbox sync so a slow sync cannot overlap the next scheduled run.

Also fix the cleanup hooks in Mailbox.vue and Outbox.vue, which used the Vue 3 "unmounted" name and therefore never ran under Vue 2.7; renamed to "destroyed" so the interval and event-bus teardown actually execute.
->https://v2.vuejs.org/v2/guide/instance#Lifecycle-Diagram

Assisted-by: ClaudeCode:claude-opus-4-8[1m]

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Skip the periodic inbox/mailbox/outbox polling while document.hidden is
true, and add an in-flight guard to the recursive inbox sync so a slow
sync cannot overlap the next scheduled run.

Also fix the cleanup hooks in Mailbox.vue and Outbox.vue, which used the
Vue 3 "unmounted" name and therefore never ran under Vue 2.7; renamed to
"destroyed" so the interval and event-bus teardown actually execute.

Assisted-by: ClaudeCode:claude-opus-4-8[1m]
Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>

@hamza221 hamza221 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the new document.hidden check is not a trivial approve.
I can split into 2 or 3 PRs

@ChristophWurst ChristophWurst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then the user is not notified of new mails? 🤔

@hamza221

Copy link
Copy Markdown
Contributor Author

But then the user is not notified of new mails? 🤔

Sorry about the lack of knowledge when it comes to this. But how is the user notified now? there are no notifications afaik

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.

2 participants