Conversation
…d on network conditions and adding network-aware polling functionality.
…mproved real-time collaboration
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @the-hercules! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
Closes #76631
Why?
High-level implementation overview
This update adds adaptive RTC polling for the HTTP polling transport using two signals:
navigator.connection.effectiveType)The goal is to reduce unnecessary polling on slower networks without changing the existing polling model or interfering with error backoff / background-tab behavior.
1. Network Information API path
For browsers that expose
navigator.connection.effectiveType, we use it as an immediate hint for active-tab polling.Implemented in:
packages/sync/src/providers/http-polling/network-info.tspackages/sync/src/providers/http-polling/polling-manager.tsWhat changed:
navigator.connection?.effectiveType4g->1x3g->4x2g/slow-2g->10x25000msso awareness stays below the server timeoutchangeevent so pending polling can be rescheduled if the browser reports a new connection type mid-session2. Cross-browser RTT fallback
For browsers that do not expose
effectiveType, polling now adapts based on recent successful poll latency.Implemented in:
packages/sync/src/providers/http-polling/latency-info.tspackages/sync/src/providers/http-polling/polling-manager.tsWhat changed:
postSyncUpdate()in the polling loop< 500ms->1x>= 500msand< 1500ms->4x>= 1500ms->10x1000ms4000msPolling behavior preserved
This change intentionally does not alter the rest of the transport model:
25000msretryNow()continues to affect retry timing only, not latency historyResult
With this change:
effectiveTypeUse of AI Tools
Codex was used to strategize and plan and also for testing. Functionality is properly tested by human.