RTC: Allow filtering of SyncConnectionModal#76554
Conversation
|
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. |
11184b4 to
4d52807
Compare
packages/editor/src/components/sync-connection-error-modal/index.tsx
Outdated
Show resolved
Hide resolved
packages/editor/src/components/sync-connection-error-modal/use-retry-countdown.ts
Outdated
Show resolved
Hide resolved
packages/editor/src/components/sync-connection-error-modal/index.tsx
Outdated
Show resolved
Hide resolved
packages/editor/src/components/sync-connection-modal/use-retry-countdown.js
Show resolved
Hide resolved
packages/editor/src/components/sync-connection-error-modal/index.tsx
Outdated
Show resolved
Hide resolved
97fdeb7 to
94ff2e7
Compare
|
Flaky tests detected in ea17603. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23221695927
|
packages/editor/src/components/sync-connection-error-modal/use-retry-countdown.ts
Outdated
Show resolved
Hide resolved
That was a bad code example. Generally you just want to return the |
|
Size Change: +28 B (0%) Total Size: 8.75 MB
ℹ️ View Unchanged
|
* Convert connection modal helpers to TypeScript * Allow filtering of SyncConnectionModal * Rename to SyncConnectionErrorModal * Add ts-ignore for packages without types * Fix the types issue and remove retryAtRef * Resolve manual retry issue * Fix type errors * Wrap in IS_GUTENBERG_PLUGIN check --------- Co-authored-by: chriszarate <czarate@git.wordpress.org> Co-authored-by: ingeniumed <ingeniumed@git.wordpress.org> Co-authored-by: shekharnwagh <shekharnwagh@git.wordpress.org> Co-authored-by: maxschmeling <maxschmeling@git.wordpress.org>
|
I just cherry-picked this PR to the wp/7.0 branch to get it included in the next release: eff769c |

What?
Rename
SyncConnectionModaltoSyncConnectionErrorModaland provide a HOC filter to allow customization by custom sync providers.Closes #76553
Why?
We provide good default error messaging for sync provider connection errors based on error codes. However, a custom sync provider may have custom messaging needs. See #76553 for details.
How?
SyncConnectionModaltoSyncConnectionErrorModalfor better clarity of purpose.editor.SyncConnectionErrorModalfilter to allow custom messaging.disconnectstatuses, additionally show it onconnectingstatuses that exceed the debounce delay.No change to modal appearance or behavior aside from item 3 above.
The refactoring was heavier than anticipated because:
canRetrywas attached to the default error messages whileretryInMswas attached to theConnectionStatus. This work puts both onConnectionStatus, giving more control to custom sync providers.refusage that made the code difficult to follow.The good news is that this code has much greater type safety along with tests.
Testing Instructions
DefaultSyncConnectionErrorModal: