feat: sync client versioning (#5645)

after this pr, server will only accept client that have some major version
the client version <0.12 will be rejected by the server, >= 0.12 can receive outdated messages and notify users
This commit is contained in:
DarkSky
2024-02-05 08:43:50 +00:00
parent 5ca0d65241
commit 25e8a2a22f
15 changed files with 144 additions and 143 deletions

View File

@@ -195,6 +195,14 @@ const useSyncEngineSyncProgress = () => {
`Syncing with AFFiNE Cloud` +
(progress ? ` (${Math.floor(progress * 100)}%)` : '')
);
} else if (
syncEngineStatus &&
syncEngineStatus.step < SyncEngineStep.Syncing
) {
return (
syncEngineStatus.error ||
'Disconnected, please check your network connection'
);
}
if (syncEngineStatus.retrying) {
return 'Sync disconnected due to unexpected issues, reconnecting.';
@@ -227,7 +235,7 @@ const useSyncEngineSyncProgress = () => {
message: content,
icon:
currentWorkspace.flavour === WorkspaceFlavour.AFFINE_CLOUD ? (
!isOnline ? (
!isOnline || syncEngineStatus?.error ? (
<OfflineStatus />
) : (
<CloudWorkspaceSyncStatus />