decaf-dev / obsidian-dataloom

Weave together data from diverse sources and display them in different views. Inspired by Excel spreadsheets and Notion.so.
https://dataloom.xyz/
MIT License
901 stars 32 forks source link

Attempt to rearrange leftmost special "column" causes an error #799

Closed awaitlink closed 8 months ago

awaitlink commented 9 months ago

Describe the bug

Attempting to rearrange the leftmost "column" (the one with row handles, not an actual column) of the table by dragging it causes TypeError: Cannot read properties of undefined (reading 'id').

Reproducible in sandbox vault with just DataLoom installed.

Steps to reproduce

  1. Create a new loom.
  2. Click and hold on the top-left corner cell of the table.
  3. Drag it along the table header row to attempt to rearrange it.
  4. Release the mouse button.

https://github.com/trey-wallis/obsidian-dataloom/assets/19972511/dbdb12eb-ac43-4166-a7e8-d124f0f06e8f

Expected behavior

No error, nothing should be changed.

Are you using the mobile app?

No

Obsidian debug info

SYSTEM INFO: Obsidian version: v1.4.14 Installer version: v1.4.14 Operating system: Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:34 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T8103 23.0.0 Login status: not logged in Insider build toggle: off Live preview: on Legacy editor: off Base theme: dark Community theme: none Snippets enabled: 0 Restricted mode: off Plugins installed: 1 Plugins enabled: 1 1: DataLoom v8.6.4

RECOMMENDATIONS: Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

Relevant log output

Uncaught TypeError: Cannot read properties of undefined (reading 'id')
    at eval (plugin:notion-like-tables:57992:33)
    at Array.forEach (<anonymous>)
    at filterByFilters (plugin:notion-like-tables:57991:11)
    at App10 (plugin:notion-like-tables:61374:26)
    at renderWithHooks (plugin:notion-like-tables:13636:26)
    at updateFunctionComponent (plugin:notion-like-tables:16024:28)
    at beginWork (plugin:notion-like-tables:17330:22)
    at HTMLUnknownElement.callCallback2 (plugin:notion-like-tables:5448:22)
    at Object.invokeGuardedCallbackDev (plugin:notion-like-tables:5473:24)
    at invokeGuardedCallback (plugin:notion-like-tables:5507:39)

plugin:notion-like-tables:57992 Uncaught TypeError: Cannot read properties of undefined (reading 'id')
    at eval (plugin:notion-like-tables:57992:33)
    at Array.forEach (<anonymous>)
    at filterByFilters (plugin:notion-like-tables:57991:11)
    at App10 (plugin:notion-like-tables:61374:26)
    at renderWithHooks (plugin:notion-like-tables:13636:26)
    at updateFunctionComponent (plugin:notion-like-tables:16024:28)
    at beginWork (plugin:notion-like-tables:17330:22)
    at HTMLUnknownElement.callCallback2 (plugin:notion-like-tables:5448:22)
    at Object.invokeGuardedCallbackDev (plugin:notion-like-tables:5473:24)
    at invokeGuardedCallback (plugin:notion-like-tables:5507:39)

plugin:notion-like-tables:15490 The above error occurred in the <App10> component:

    at App10 (plugin:notion-like-tables:61294:18)
    at MenuProvider (plugin:notion-like-tables:47843:25)
    at DragProvider (plugin:notion-like-tables:47149:25)
    at LoomStateProvider (plugin:notion-like-tables:42871:17)
    at Provider (plugin:notion-like-tables:42417:10)
    at AppMountProvider (plugin:notion-like-tables:42842:3)
    at ErrorBoundary (plugin:notion-like-tables:61664:5)
    at LoomApp (plugin:notion-like-tables:61699:3)

React will try to recreate this component tree from scratch using the error boundary you provided, ErrorBoundary.
decaf-dev commented 9 months ago

Thanks for finding this.