[web] do not show the cannot sync modal if still offline (#35939)

GitOrigin-RevId: 20c6f138e05fb8459b27f8ea9b376c21c7820799
This commit is contained in:
Kristina
2026-09-17 11:41:13 +00:00
committed by Copybot
parent ba76fda37b
commit 1f97dbc789
2 changed files with 77 additions and 3 deletions
@@ -86,7 +86,8 @@ export const EditorManagerProvider: FC<React.PropsWithChildren> = ({
const { t } = useTranslation()
const { reportError, eventEmitter, projectId, setOutOfSync } =
useIdeReactContext()
const { socket, closeConnection, connectionState } = useConnectionContext()
const { socket, closeConnection, connectionState, isConnected } =
useConnectionContext()
const { view, setView, setOpenFile } = useLayoutContext()
const {
showGenericMessageModal,
@@ -587,6 +588,13 @@ export const EditorManagerProvider: FC<React.PropsWithChildren> = ({
document.doc_id
)
if (hasOfflineBackup) {
if (!isConnected) {
// Still offline, so nothing has been rejected yet: this is the
// fatal op timeout running out while the outage is ongoing. Keep
// the backup and let recovery on the next load report the outcome,
// rather than declaring a failed sync mid-outage.
return
}
eventEmitter.emit('ide:unableToSyncOfflineChanges', {
docId: document.doc_id,
editorContent: editorContent || '',
@@ -624,6 +632,7 @@ export const EditorManagerProvider: FC<React.PropsWithChildren> = ({
setOutOfSync,
t,
projectId,
isConnected,
])
useEffect(() => {