Skip to content

fix(wework): correct cloud work refresh status - #2516

Merged
qdaxb merged 1 commit into
mainfrom
fix/cloud-work-refresh-status
Aug 9, 2026
Merged

fix(wework): correct cloud work refresh status#2516
qdaxb merged 1 commit into
mainfrom
fix/cloud-work-refresh-status

Conversation

@qdaxb

@qdaxb qdaxb commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

What changed

  • separate the latest cloud availability result from the last successful cloud data snapshot
  • show Syncing only during the first complete cloud probe
  • keep the previous Available, No devices, or Unavailable result visible during later refreshes
  • replace the overlapping device-only refresh path with a complete latest-request-wins refresh
  • document the Cloud Work status semantics in Chinese and English

Root cause

The sidebar status reused lastGood, which is a data cache, as the current availability result. A failed or superseded refresh could therefore fall back to a historical successful status. Overlapping refreshes also had a device-only path that did not publish failures back into the cloud status state.

Impact

Cloud Work now becomes unavailable when Backend reads fail, while cached devices and runtime work may still remain visible. Later refreshes no longer flash through Syncing; they transition directly between the last completed result and the new completed result.

Validation

  • Wework pre-push ESLint, TypeScript, and full unit test suite
  • focused cloud status, WorkbenchProvider, and DesktopSidebar tests: 264 passed
  • isolated Tauri startup and sidebar inspection
  • Prettier and git diff --check

Summary by CodeRabbit

  • Bug Fixes

    • Cloud Work status now accurately reflects complete background checks across teams, devices, and runtime work.
    • Displays “Syncing” during the initial check and preserves the latest completed result during refreshes.
    • Reports “Unavailable” when cloud data cannot be read, while retaining the most recent successful snapshot.
    • Replaces overlapping refreshes with the latest full check, improving refresh reliability.
  • Documentation

    • Updated English and Chinese guides to describe the revised Cloud Work status behavior.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 67f04d29-8078-4bd7-8e7a-565868c84dbf

📥 Commits

Reviewing files that changed from the base of the PR and between a6eb66f and 59ee7ba.

📒 Files selected for processing (6)
  • docs/en/wework/developer-guide/wework-cloud-connection.md
  • docs/zh/wework/developer-guide/wework-cloud-connection.md
  • wework/src/features/workbench/WorkbenchProvider.test.tsx
  • wework/src/features/workbench/useWorkbenchDataRefresh.ts
  • wework/src/features/workbench/workbenchCloudStatus.test.ts
  • wework/src/features/workbench/workbenchCloudStatus.ts

📝 Walkthrough

Walkthrough

Cloud Work status now reflects complete background probes. Initial checks show Syncing, refreshes retain the latest completed result, failures show Unavailable, and overlapping refreshes replace earlier requests.

Changes

Cloud Work Status

Layer / File(s) Summary
Status lifecycle and snapshot selection
wework/src/features/workbench/workbenchCloudStatus.ts, wework/src/features/workbench/workbenchCloudStatus.test.ts
Initial checks enter syncing. Later refreshes retain the current snapshot until completion. Status selection uses state.current, including failure and recovery cases.
Full refresh replacement
wework/src/features/workbench/useWorkbenchDataRefresh.ts, wework/src/features/workbench/WorkbenchProvider.test.tsx
A new refresh abandons and aborts the previous request, then runs the standard full synchronization flow. Tests verify status transitions and abort behavior.
Documented status behavior
docs/en/wework/developer-guide/wework-cloud-connection.md, docs/zh/wework/developer-guide/wework-cloud-connection.md
The developer guides describe syncing, snapshot retention, failures, and replacement of overlapping refreshes.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant WorkbenchProvider
  participant refreshCloudBackgroundData
  participant workbenchCloudStatus
  participant CloudServices
  WorkbenchProvider->>refreshCloudBackgroundData: request cloud refresh
  refreshCloudBackgroundData->>refreshCloudBackgroundData: abandon and abort previous refresh
  refreshCloudBackgroundData->>workbenchCloudStatus: mark checks as syncing
  refreshCloudBackgroundData->>CloudServices: probe teams, devices, and runtime work
  CloudServices-->>refreshCloudBackgroundData: return probe results
  refreshCloudBackgroundData->>workbenchCloudStatus: publish completed or unavailable status
Loading

Possibly related PRs

  • wecode-ai/Wegent#1824: Both changes modify current versus last-completed cloud status during refresh.
  • wecode-ai/Wegent#1998: Both changes cover cloud refresh cancellation, status tracking, and recovery.
  • wecode-ai/Wegent#2421: Both changes modify superseded refresh handling in the workbench refresh and status lifecycle.

Suggested reviewers: icycrystal4

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the PR's main change: correcting Cloud Work refresh status handling.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/cloud-work-refresh-status

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qdaxb
qdaxb marked this pull request as ready for review August 9, 2026 05:36
@qdaxb
qdaxb added this pull request to the merge queue Aug 9, 2026
Merged via the queue into main with commit 7ab6f8c Aug 9, 2026
74 checks passed
@qdaxb
qdaxb deleted the fix/cloud-work-refresh-status branch August 9, 2026 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant