fix(cloud): serialize directory catch-up (#2500)

Co-authored-by: dadachann <185672915+dadachann@users.noreply.github.com>
This commit is contained in:
Hyu
2026-09-02 21:57:53 +08:00
committed by GitHub
parent 018dd7a363
commit c8d8b1aac4
4 changed files with 133 additions and 3 deletions
@@ -453,13 +453,28 @@ class UserRouterGroup(group.RouterGroup):
)
break
except WorkspaceNotFoundError:
if projection_service is None or attempt == 3:
if projection_service is None:
raise
elif projection_service is None or attempt == 3:
elif projection_service is None:
break
if attempt == 3:
break
await projection_service.sync_once()
account = await self.ap.user_service.get_user_by_uuid(launch['account_uuid'])
if access is None and projection_service is not None:
# The target event may be deeper than the bounded incremental
# page budget. One authoritative signed snapshot catches this
# process up without turning the callback into unbounded polling.
await projection_service.refresh_snapshot()
account = await self.ap.user_service.get_user_by_uuid(launch['account_uuid'])
if account is not None:
self.ap.user_service._require_active_account(account)
access = await self.ap.workspace_collaboration_service.resolve_account_workspace(
account.uuid,
launch['workspace_uuid'],
)
if account is None:
raise SpaceLaunchError('Launch Account is not projected into Core')
if access is None: # pragma: no cover - bounded loop resolves or raises.