ci(e2e): bump TSIO report-upload pin for 504 retries - #3916
Conversation
Pin test-system-io-report-upload to 19aef73 so screenshot uploads retry on gateway timeouts instead of failing the desktop e2e report group. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe PR updates the TSIO report upload action, strengthens E2E tab synchronization, ignores secondary-view logout and expiry events, and prevents redundant server login-state events. ChangesTSIO action update
Tab and login-state stability
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ViewManager
participant webContentsManager
participant ServerManager
participant AppState
ViewManager->>webContentsManager: Receive login or expiry event
webContentsManager->>ViewManager: Check primary-view status
webContentsManager->>ServerManager: Update login state when allowed
webContentsManager->>AppState: Update expiry state when allowed
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Loading secondary Mattermost tabs can emit TAB_LOGIN_CHANGED(false) before the shared session is visible; that was treated as a server-wide logout and destroyed non-primary tabs, flaking MM-T4385. Ignore logout from non-primary views, skip redundant setLoggedIn emits, and switch window_menu setup via TabManager instead of DOM click + focusMainWindow. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
e2e/specs/menu_bar/window_menu.test.ts (1)
245-252: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winFixed 2s stability loop runs on every
createExtraTabscall.This adds a flat ~2s of wall-clock time to every call to this helper. If
createExtraTabsis invoked more than once across the suite, this cost compounds. Consider running this stability check once (e.g., in a dedicated regression test) rather than unconditionally inside the shared helper.
[recommended_refactor]As per path instructions, e2e guidance states to "Prefer fixes that improve determinism, reduce suite runtime, preserve real-user behavior, and strengthen shared infrastructure over patching individual flaky specs."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@e2e/specs/menu_bar/window_menu.test.ts` around lines 245 - 252, Move the repeated 2-second stability loop out of the shared createExtraTabs helper and run it only once in a dedicated regression test or setup path. Keep createExtraTabs focused on creating tabs, while preserving the buildServerMap assertion that verifies secondary Mattermost tabs remain registered.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/app/views/webContentsManager.ts`:
- Around line 180-194: Update handleSessionExpired to mirror the primary-view
guard used in handleTabLoggedIn: when the session-expired event comes from a
non-primary view, return without calling setLoggedIn(view, false). Preserve the
existing expiration handling for the primary view.
---
Nitpick comments:
In `@e2e/specs/menu_bar/window_menu.test.ts`:
- Around line 245-252: Move the repeated 2-second stability loop out of the
shared createExtraTabs helper and run it only once in a dedicated regression
test or setup path. Keep createExtraTabs focused on creating tabs, while
preserving the buildServerMap assertion that verifies secondary Mattermost tabs
remain registered.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 22a3ad87-fb25-4244-bea4-9c1bad311ebe
📒 Files selected for processing (5)
e2e/specs/menu_bar/window_menu.test.tssrc/app/views/webContentsManager.test.jssrc/app/views/webContentsManager.tssrc/common/servers/serverManager.test.jssrc/common/servers/serverManager.ts
Mirror the primary-view logout guard in handleSessionExpired so a secondary tab cannot tear down siblings, and move the window_menu tab-stability loop into a dedicated regression test. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
e2e/specs/menu_bar/window_menu.test.ts (1)
243-254: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winAssert that the same tabs survive, not only that the count stays high.
createExtraTabs()returns aServerMap, but the caller discards it, while the helper and post-navigation check validate only tab counts. A tab could be torn down and replaced while the count remains>= 3, allowing this regression test to pass incorrectly. Preserve the initialwebContentsIdvalues and assert that they remain present in each rebuilt map;buildServerMapalready exposes those IDs.Suggested assertion change
-async function assertSecondaryTabsRemainRegistered(serverName: string) { +async function assertSecondaryTabsRemainRegistered(serverName: string, expectedIds: number[]) { for (let i = 0; i < 10; i++) { await new Promise((resolve) => setTimeout(resolve, 200)); const map = await buildServerMap(electronApp); + const currentIds = (map[serverName] ?? []).map(({webContentsId}) => webContentsId); + expect(currentIds).toEqual(expect.arrayContaining(expectedIds)); expect( map[serverName]?.length ?? 0, 'Secondary Mattermost tabs must remain registered after creation', ).toBeGreaterThanOrEqual(3); } } - await createExtraTabs(); - await assertSecondaryTabsRemainRegistered(windowMenuConfig.servers[0].name); + const initialMap = await createExtraTabs(); + const expectedIds = initialMap[windowMenuConfig.servers[0].name].map(({webContentsId}) => webContentsId); + await assertSecondaryTabsRemainRegistered(windowMenuConfig.servers[0].name, expectedIds);Also applies to: 258-285, 387-390
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@e2e/specs/menu_bar/window_menu.test.ts` around lines 243 - 254, Update the secondary-tab regression flow around createExtraTabs, assertSecondaryTabsRemainRegistered, and the post-navigation check to preserve the initially returned ServerMap and its webContentsId values. Pass those expected IDs into each validation and assert every rebuilt buildServerMap result still contains the same IDs, while retaining the existing count checks where applicable.
🧹 Nitpick comments (1)
e2e/specs/menu_bar/window_menu.test.ts (1)
246-256: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winReplace the fixed sleep window with a readiness-based poll.
Ten
setTimeout(200)iterations cover exactly two seconds regardless of loading progress. Slow CI runs can still be in the vulnerable loading phase after the loop ends, while fast runs incur an unnecessary fixed delay. Use the existing shell-readiness/polling helpers and continue checking registration until the target views are ready.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@e2e/specs/menu_bar/window_menu.test.ts` around lines 246 - 256, Update assertSecondaryTabsRemainRegistered to replace the fixed ten-iteration setTimeout loop with the existing shell-readiness/polling helpers. Continue polling the server map until the target secondary views are ready, while preserving the assertion that at least three tabs remain registered during the check.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/app/views/webContentsManager.test.js`:
- Line 434: Replace the new require() calls for AppState and ipcMain in the
affected tests with ES-module imports in the file’s top-level import block, then
reuse those existing bindings throughout the test cases instead of performing
duplicate Electron or AppState lookups.
---
Outside diff comments:
In `@e2e/specs/menu_bar/window_menu.test.ts`:
- Around line 243-254: Update the secondary-tab regression flow around
createExtraTabs, assertSecondaryTabsRemainRegistered, and the post-navigation
check to preserve the initially returned ServerMap and its webContentsId values.
Pass those expected IDs into each validation and assert every rebuilt
buildServerMap result still contains the same IDs, while retaining the existing
count checks where applicable.
---
Nitpick comments:
In `@e2e/specs/menu_bar/window_menu.test.ts`:
- Around line 246-256: Update assertSecondaryTabsRemainRegistered to replace the
fixed ten-iteration setTimeout loop with the existing shell-readiness/polling
helpers. Continue polling the server map until the target secondary views are
ready, while preserving the assertion that at least three tabs remain registered
during the check.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: fb3ef26f-e78c-40f7-b8c4-efca7c15dc99
📒 Files selected for processing (3)
e2e/specs/menu_bar/window_menu.test.tssrc/app/views/webContentsManager.test.jssrc/app/views/webContentsManager.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/app/views/webContentsManager.ts
Reuse top-level ipcMain/AppState imports in webContentsManager tests, and assert createExtraTabs webContentsIds stay registered via shell-readiness polling instead of a fixed sleep loop. Co-authored-by: Cursor <cursoragent@cursor.com>
The secondary-tab regression helper was waiting up to 60s per background tab for Mattermost shell readiness, adding several minutes per OS. Poll stable webContentsIds instead; MM-T4385 navigation already covers shell. Co-authored-by: Cursor <cursoragent@cursor.com>
The dedicated createExtraTabs + poll case duplicated MM-T4385 setup cost without unique coverage; the app-side logout/expiry guards plus ID checks in switchToTabAndOpenChannel already protect the flake. Co-authored-by: Cursor <cursoragent@cursor.com>
Treat stuck in_progress with 0 failures as success for PR/master/CMT commit status and channel posts, poll longer for all shards, and pin report-upload to the current production release-0.11.0 tag. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
report-upload walks every png under screenshots-dir; Electron userdata under test-results was contributing thousands of cache/icon images. Collect image attachments from failed results into a dedicated folder. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Pin test-system-io-report-upload to 19aef73 so screenshot uploads retry on gateway timeouts instead of failing the desktop e2e report group.
Change Impact: 🟡 Medium
Regression Risk: Login/logout and
session_expiredhandling was changed to ignore signals from non-primary views, andServerManager.setLoggedInnow short-circuits on unchanged state. This is auth-adjacent and could affect multi-tab/session behavior, but the change is localized to view-driven state updates and is covered by added/updated unit tests.QA Recommendation: Rely on automated test coverage; run a brief manual smoke test covering login/logout and session-expired behavior triggered from a secondary tab/window to confirm server login state and cookies are only affected from the primary view.
Generated by CodeRabbitAI