Skip to content

fix(editor): add index checking to selected elements array #21575

fix(editor): add index checking to selected elements array

fix(editor): add index checking to selected elements array #21575

Triggered via pull request December 31, 2024 05:59
@L-SunL-Sun
synchronize #9453
L-Sun-patch-1
Status Cancelled
Total duration 8m 28s
Artifacts 8

build-test.yml

on: pull_request
Optimize CI
7s
Optimize CI
Matrix: build-native
Build Server native
1m 1s
Build Server native
Build @affine/electron renderer
2m 13s
Build @affine/electron renderer
test-build-mobile-app  /  output-env
2s
test-build-mobile-app / output-env
Matrix: Analyze
Matrix: Legacy Blocksuite E2E Test
Matrix: E2E Mobile Test
Matrix: E2E Test
Matrix: Unit Test
Matrix: Server Copilot E2E Test
Matrix: server-e2e-test
Server Test
5m 56s
Server Test
Server Copilot Api Test
27s
Server Copilot Api Test
Matrix: desktop-test
test-build-mobile-app  /  build-android-web
2m 17s
test-build-mobile-app / build-android-web
test-build-mobile-app  /  build-ios-web
2m 11s
test-build-mobile-app / build-ios-web
test-build-mobile-app  /  android
2m 38s
test-build-mobile-app / android
test-build-mobile-app  /  ios
4m 57s
test-build-mobile-app / ios
3, 2, 1 Launch
0s
3, 2, 1 Launch
Fit to window
Zoom out
Zoom in

Annotations

27 errors, 58 warnings, and 22 notices
[Mobile Safari] › explorer-folder.spec.ts:62:5 › create a folder and rename it: tests/affine-mobile/e2e/explorer-folder.spec.ts#L19
1) [Mobile Safari] › explorer-folder.spec.ts:62:5 › create a folder and rename it ──────────────── Error: expect(received).toEqual(expected) // deep equality Expected: "rename-input" Received: null 17 | const isRenameInputFocused = async (page: Page) => { 18 | const focusElTestid = await getAttrOfActiveElement(page); > 19 | expect(focusElTestid).toEqual('rename-input'); | ^ 20 | }; 21 | 22 | const createRootFolder = async (page: Page, name: string) => { at isRenameInputFocused (/home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:19:25) at createRootFolder (/home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:27:3) at /home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:66:18
slash-menu.spec.ts:378:3 › slash menu should show and hide correctly › should open and close menu when using left right arrow: blocksuite/tests-legacy/slash-menu.spec.ts#L401
1) slash-menu.spec.ts:378:3 › slash menu should show and hide correctly › should open and close menu when using left right arrow, Enter, Esc keys Error: Timed out 5000ms waiting for expect(locator).toHaveAttribute(expected) Locator: locator('.slash-menu[data-testid=sub-menu-0]').locator('icon-button').nth(4) Expected string: "true" Received string: "false" Call log: - expect.toHaveAttribute with timeout 5000ms - waiting for locator('.slash-menu[data-testid=sub-menu-0]').locator('icon-button').nth(4) 9 × locator resolved to <icon-button width="100%" tabindex="0" height="44px" hover="false" role="button" text="Other Headings" data-test-disabled="false" data-testid="Other Headings" class="slash-menu-item other-headings">…</icon-button> - unexpected value "false" 399 | await type(page, '/'); 400 | await pressArrowDown(page, 4); > 401 | await expect(slashItems.nth(4)).toHaveAttribute('hover', 'true'); | ^ 402 | await expect(slashItems.nth(4).locator('.text')).toHaveText([ 403 | 'Other Headings', 404 | ]); at /home/runner/work/AFFiNE/AFFiNE/blocksuite/tests-legacy/slash-menu.spec.ts:401:37
format-bar.spec.ts:238:1 › should format quick bar be able to change background color: blocksuite/tests-legacy/format-bar.spec.ts#L276
1) format-bar.spec.ts:238:1 › should format quick bar be able to change background color ───────── TimeoutError: locator.click: Timeout 5000ms exceeded. Call log: - waiting for locator('.affine-format-bar-widget').getByTestId('unset') - locator resolved to <editor-menu-action role="button" data-testid="unset">…</editor-menu-action> - attempting click action - waiting for element to be visible, enabled and stable - element is not stable - retrying click action - waiting for element to be visible, enabled and stable - element is not visible - retrying click action - waiting 20ms 2 × waiting for element to be visible, enabled and stable - element is not visible - retrying click action - waiting 100ms 9 × waiting for element to be visible, enabled and stable - element is not visible - retrying click action - waiting 500ms 274 | 275 | await expect(highlight.defaultColorBtn).toBeVisible(); > 276 | await highlight.defaultColorBtn.click(); | ^ 277 | 278 | expect(await getPageSnapshot(page, true)).toMatchSnapshot( 279 | `${testInfo.title}_default_color.json` at /home/runner/work/AFFiNE/AFFiNE/blocksuite/tests-legacy/format-bar.spec.ts:276:35
hotkey/hotkey.spec.ts:437:3 › keyboard operation to move block up or down › keep cursor: blocksuite/tests-legacy/utils/asserts.ts#L332
2) hotkey/hotkey.spec.ts:437:3 › keyboard operation to move block up or down › keep cursor ─────── Error: expect(received).toEqual(expected) // deep equality Expected: {"index": 3, "length": 0} Received: null at utils/asserts.ts:332 330 | [richTextIndex, currentEditorIndex] 331 | ); > 332 | expect(actual).toEqual({ index: rangeIndex, length: rangeLength }); | ^ 333 | } 334 | 335 | export async function assertNativeSelectionRangeCount( at assertRichTextInlineRange (/home/runner/work/AFFiNE/AFFiNE/blocksuite/tests-legacy/utils/asserts.ts:332:18) at /home/runner/work/AFFiNE/AFFiNE/blocksuite/tests-legacy/hotkey/hotkey.spec.ts:453:5
attachment.spec.ts:705:1 › cancel file picker with input element resolves: blocksuite/tests-legacy/attachment.spec.ts#L725
1) attachment.spec.ts:705:1 › cancel file picker with input element resolves ───────────────────── TimeoutError: page.waitForEvent: Timeout 5000ms exceeded while waiting for event "filechooser" =========================== logs =========================== waiting for event "filechooser" ============================================================ 723 | await expect(slashMenu).toBeVisible(); 724 | > 725 | const fileChooser = page.waitForEvent('filechooser'); | ^ 726 | await pressEnter(page); 727 | const inputFile = page.locator("input[type='file']"); 728 | await expect(inputFile).toHaveCount(1); at /home/runner/work/AFFiNE/AFFiNE/blocksuite/tests-legacy/attachment.spec.ts:725:28
clipboard/list.spec.ts:215:1 › paste nested lists to a nested list: blocksuite/tests-legacy/utils/asserts.ts#L210
2) clipboard/list.spec.ts:215:1 › paste nested lists to a nested list ──────────────────────────── Error: expect(received).toEqual(expected) // deep equality - Expected - 2 + Received + 2 Array [ "aaa", - "111", + "bbb111", "222", "111", - "222bbb", + "222", "ccc", ] at utils/asserts.ts:210 208 | }); 209 | }, currentEditorIndex); > 210 | expect(actualTexts).toEqual(texts); | ^ 211 | } 212 | 213 | export async function assertEdgelessCanvasText(page: Page, text: string) { at assertRichTexts (/home/runner/work/AFFiNE/AFFiNE/blocksuite/tests-legacy/utils/asserts.ts:210:23) at /home/runner/work/AFFiNE/AFFiNE/blocksuite/tests-legacy/clipboard/list.spec.ts:257:3
Lint
Process completed with exit code 1.
edgeless/shortcut.spec.ts:119:1 › should not switch shapes in editing: blocksuite/tests-legacy/utils/actions/edgeless.ts#L368
1) edgeless/shortcut.spec.ts:119:1 › should not switch shapes in editing ───────────────────────── TimeoutError: locator.click: Timeout 5000ms exceeded. Call log: - waiting for locator('edgeless-slide-menu edgeless-tool-icon-button').filter({ hasText: 'Square' }) - locator resolved to <edgeless-tool-icon-button role="button">…</edgeless-tool-icon-button> - attempting click action 2 × waiting for element to be visible, enabled and stable - element is not stable - retrying click action - waiting 20ms - waiting for element to be visible, enabled and stable - element is not stable - retrying click action - waiting 100ms - waiting for element to be visible, enabled and stable - element was detached from the DOM, retrying at utils/actions/edgeless.ts:368 366 | .locator('edgeless-slide-menu edgeless-tool-icon-button') 367 | .filter({ hasText: shape }); > 368 | await squareShapeButton.click(); | ^ 369 | break; 370 | } 371 | } at setEdgelessTool (/home/runner/work/AFFiNE/AFFiNE/blocksuite/tests-legacy/utils/actions/edgeless.ts:368:31) at /home/runner/work/AFFiNE/AFFiNE/blocksuite/tests-legacy/edgeless/shortcut.spec.ts:137:3
links.spec.ts:249:5 › allow switching to embed view when linking to the other document with mode: tests/affine-local/e2e/links.spec.ts#L286
1) links.spec.ts:249:5 › allow switching to embed view when linking to the other document with mode TimeoutError: locator.click: Timeout 5000ms exceeded. Call log: - waiting for locator('affine-embed-linked-doc-block') - locator resolved to <affine-embed-linked-doc-block contenteditable="false" data-block-id="-Z00cjcwYSzMPjA5uYhJy">…</affine-embed-linked-doc-block> - attempting click action 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - <iframe src="about:blank" id="webpack-dev-server-client-overlay"></iframe> intercepts pointer events - retrying click action - waiting 20ms 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - <iframe src="about:blank" id="webpack-dev-server-client-overlay"></iframe> intercepts pointer events - retrying click action - waiting 100ms 9 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - <iframe src="about:blank" id="webpack-dev-server-client-overlay"></iframe> intercepts pointer events - retrying click action - waiting 500ms 284 | 285 | await expect(cardLink).toBeVisible(); > 286 | await cardLink.click(); | ^ 287 | 288 | // refocus 289 | await cardLink.click(); at /home/runner/work/AFFiNE/AFFiNE/tests/affine-local/e2e/links.spec.ts:286:18
Server Test
Canceling since a higher priority waiting request for 'Build & Test-refs/pull/9453/merge' exists
Desktop Test (windows-latest, windows, x64, x86_64-pc-windows-msvc, true)
Canceling since a higher priority waiting request for 'Build & Test-refs/pull/9453/merge' exists
Server E2E Test 2/3
Canceling since a higher priority waiting request for 'Build & Test-refs/pull/9453/merge' exists
Server E2E Test 2/3
The operation was canceled.
Desktop Test (ubuntu-latest, linux, x64, x86_64-unknown-linux-gnu, true)
Canceling since a higher priority waiting request for 'Build & Test-refs/pull/9453/merge' exists
Server E2E Test 1/3
Canceling since a higher priority waiting request for 'Build & Test-refs/pull/9453/merge' exists
Server E2E Test 1/3
The operation was canceled.
Analyze (typescript)
Canceling since a higher priority waiting request for 'Build & Test-refs/pull/9453/merge' exists
Analyze (typescript)
The operation was canceled.
Analyze (javascript)
Canceling since a higher priority waiting request for 'Build & Test-refs/pull/9453/merge' exists
Analyze (javascript)
The operation was canceled.
Desktop Test (macos-latest, macos, arm64, aarch64-apple-darwin, true)
Canceling since a higher priority waiting request for 'Build & Test-refs/pull/9453/merge' exists
Desktop Test (macos-latest, macos, arm64, aarch64-apple-darwin, true)
The operation was canceled.
test-build-mobile-app / ios
Canceling since a higher priority waiting request for 'Build & Test-refs/pull/9453/merge' exists
test-build-mobile-app / ios
The operation was canceled.
3, 2, 1 Launch
Process completed with exit code 1.
Optimize CI
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
test-build-mobile-app / output-env
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Check yarn binary
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Build AFFiNE native (x86_64-unknown-linux-gnu)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Build Server native
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Server Copilot E2E Test (1, 3)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Server Copilot Api Test
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Server Copilot E2E Test (3, 3)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Server Copilot E2E Test (2, 3)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Run native tests
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Build @affine/electron renderer
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
test-build-mobile-app / build-ios-web
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
test-build-mobile-app / build-android-web
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
E2E Mobile Test (5)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Slow Test: tests/affine-mobile/[Mobile Chrome] › explorer-tag.spec.ts#L1
tests/affine-mobile/[Mobile Chrome] › explorer-tag.spec.ts took 44.4s
E2E Mobile Test (2)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Slow Test: tests/affine-mobile/[Mobile Safari] › explorer-tag.spec.ts#L1
tests/affine-mobile/[Mobile Safari] › explorer-tag.spec.ts took 1.4m
Legacy Blocksuite E2E Test (2)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Legacy Blocksuite E2E Test (10)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
E2E Mobile Test (4)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Slow Test: tests/affine-mobile/[Mobile Chrome] › detail.spec.ts#L1
tests/affine-mobile/[Mobile Chrome] › detail.spec.ts took 45.5s
Slow Test: tests/affine-mobile/[Mobile Chrome] › explorer-favorite.spec.ts#L1
tests/affine-mobile/[Mobile Chrome] › explorer-favorite.spec.ts took 43.0s
E2E Mobile Test (1)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Slow Test: tests/affine-mobile/[Mobile Safari] › back-button-visibility.spec.ts#L1
tests/affine-mobile/[Mobile Safari] › back-button-visibility.spec.ts took 47.6s
Legacy Blocksuite E2E Test (9)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
E2E Mobile Test (3)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Slow Test: tests/affine-mobile/[Mobile Safari] › home.spec.ts#L1
tests/affine-mobile/[Mobile Safari] › home.spec.ts took 46.3s
Legacy Blocksuite E2E Test (8)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Legacy Blocksuite E2E Test (7)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Legacy Blocksuite E2E Test (1)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Legacy Blocksuite E2E Test (5)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Lint
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Legacy Blocksuite E2E Test (3)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Legacy Blocksuite E2E Test (6)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
E2E Test (1)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
test-build-mobile-app / android
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
E2E Test (4)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Slow Test: tests/affine-local/local-first-favorites-items.spec.ts#L1
tests/affine-local/local-first-favorites-items.spec.ts took 40.1s
Unit Test (3)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Legacy Blocksuite E2E Test (4)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
E2E Test (2)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
E2E Test (5)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Unit Test (4)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Unit Test (5)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Server Desktop E2E Test
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Slow Test: tests/affine-desktop-cloud/basic.spec.ts#L1
tests/affine-desktop-cloud/basic.spec.ts took 55.4s
E2E Test (3)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Slow Test: tests/affine-local/local-first-avatar.spec.ts#L1
tests/affine-local/local-first-avatar.spec.ts took 16.2s
Unit Test (2)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Unit Test (1)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Server E2E Test 3/3
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Slow Test: tests/affine-cloud/workspace.spec.ts#L1
tests/affine-cloud/workspace.spec.ts took 1.3m
Analyze (typescript)
1 issue was detected with this workflow: CodeQL language 'javascript' is referenced by more than one entry in the 'language' matrix parameter for job 'analyze'. This may result in duplicate alerts. Please edit the 'language' matrix parameter to keep only one of the following: 'javascript', 'typescript'.
Analyze (typescript)
Unable to validate code scanning workflow: DuplicateLanguageInMatrix
Analyze (javascript)
1 issue was detected with this workflow: CodeQL language 'javascript' is referenced by more than one entry in the 'language' matrix parameter for job 'analyze'. This may result in duplicate alerts. Please edit the 'language' matrix parameter to keep only one of the following: 'javascript', 'typescript'.
Analyze (javascript)
Unable to validate code scanning workflow: DuplicateLanguageInMatrix
test-build-mobile-app / ios
swiftformat 0.55.3 is already installed and up-to-date. To reinstall 0.55.3, run: brew reinstall swiftformat
3, 2, 1 Launch
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
🎭 Playwright Run Summary
7 passed (1.2m)
🎭 Playwright Run Summary
1 flaky [Mobile Safari] › explorer-folder.spec.ts:62:5 › create a folder and rename it ───────────────── 6 passed (1.7m)
🎭 Playwright Run Summary
4 skipped 95 passed (1.5m)
🎭 Playwright Run Summary
1 flaky slash-menu.spec.ts:378:3 › slash menu should show and hide correctly › should open and close menu when using left right arrow, Enter, Esc keys 3 skipped 94 passed (1.4m)
🎭 Playwright Run Summary
7 passed (1.3m)
🎭 Playwright Run Summary
8 passed (1.8m)
🎭 Playwright Run Summary
98 passed (1.4m)
🎭 Playwright Run Summary
7 passed (1.4m)
🎭 Playwright Run Summary
3 skipped 95 passed (1.5m)
🎭 Playwright Run Summary
2 flaky format-bar.spec.ts:238:1 › should format quick bar be able to change background color ────────── hotkey/hotkey.spec.ts:437:3 › keyboard operation to move block up or down › keep cursor ──────── 1 skipped 95 passed (1.8m)
🎭 Playwright Run Summary
2 flaky attachment.spec.ts:705:1 › cancel file picker with input element resolves ────────────────────── clipboard/list.spec.ts:215:1 › paste nested lists to a nested list ───────────────────────────── 3 skipped 94 passed (1.4m)
🎭 Playwright Run Summary
12 skipped 87 passed (2.1m)
🎭 Playwright Run Summary
6 skipped 93 passed (2.4m)
🎭 Playwright Run Summary
1 flaky edgeless/shortcut.spec.ts:119:1 › should not switch shapes in editing ────────────────────────── 4 skipped 93 passed (2.4m)
🎭 Playwright Run Summary
1 skipped 36 passed (3.4m)
🎭 Playwright Run Summary
1 skipped 35 passed (3.4m)
🎭 Playwright Run Summary
1 skipped 98 passed (2.8m)
🎭 Playwright Run Summary
37 passed (3.8m)
🎭 Playwright Run Summary
1 skipped 35 passed (3.4m)
🎭 Playwright Run Summary
1 passed (1.2m)
🎭 Playwright Run Summary
1 flaky links.spec.ts:249:5 › allow switching to embed view when linking to the other document with mode 2 skipped 33 passed (4.2m)
🎭 Playwright Run Summary
2 passed (1.5m)

Artifacts

Produced during runtime
Name Size
affine.darwin-arm64.node
1.92 MB
affine.darwin-x64.node
2.04 MB
affine.linux-x64-gnu.node
2.08 MB
affine.win32-x64-msvc.node
2.43 MB
android
60.6 MB
ios
60.7 MB
server-native.node
4.32 MB
web
62.7 MB