Badget icon indicating copy to clipboard operation
Badget copied to clipboard

feat: add connector list api and config form

Open matteobad opened this issue 1 year ago • 5 comments

Description

What type of PR is this? (check all applicable)

  • [ ] 💡 Feature
  • [ ] 🐛 Bug Fix
  • [ ] 📝 Documentation Update
  • [ ] 🎨 Style
  • [ ] 🧑‍💻 Code Refactor
  • [ ] 🔥 Performance Improvements
  • [ ] ✅ Test
  • [ ] 🤖 Build
  • [ ] 🔁 CI
  • [ ] 📦 Chore (Release)
  • [ ] ⏩ Revert

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings

Steps to QA

Added to documentation?

  • [ ] 📜 README.md
  • [ ] 🙅 no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

matteobad avatar Feb 13 '24 23:02 matteobad

@matteobad is attempting to deploy a commit to the Salgsmaskin Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Feb 13 '24 23:02 vercel[bot]

Errors Encountered with drizzle-kit Operations and Runtime Database Table Access

Issue 1: drizzle-kit Database Push Error

When attempting to push database changes using drizzle-kit, the operation fails with a TypeError related to accessing the type property of an undefined object. This error occurs during the schema update process, specifically when handling column operations in the projectx_transaction table.

image image

Error Output:

TypeError: Cannot read properties of undefined (reading 'type')
at /Users/christer/money/money/node_modules/drizzle-kit/bin.cjs:62369:119

Context:

The error appears after attempting to create or rename several columns to additional_data in the projectx_transaction table. The operations include creating a new column and renaming existing columns such as plaid_account_id, check_number, etc., to additional_data.

Attempted Operations:

  • Creating additional_data column
  • Renaming multiple columns to additional_data
  • pnpm run db:push

Issue 2: Runtime Error Accessing projectx_connectors Table

A runtime error occurs when navigating to the Connectors settings in the application UI, indicating an issue with accessing the projectx_connectors table, which is reportedly missing.

image

Error Output:

Error: target: propwrite.-.primary: vttablet: rpc error: code = NotFound desc = Table 'propwrite.projectx_connectors' doesn't exist (errno 1146) (sqlstate 42S02)

Additional Console Error on Accessing Connectors Page

When attempting to access the Connectors page within the application, the following console output is observed, indicating an error in the tRPC handler related to the missing projectx_connectors table in the database.

Console Output:

www:dev: >> query #1 connectors.listConnectors { input: undefined }
www:dev: Error in tRPC handler (lambda) on path connectors.listConnectors
www:dev: DatabaseError: target: propwrite.-.primary: vttablet: rpc error: code = NotFound desc = Table 'propwrite.projectx_connectors' doesn't exist (errno 1146) (sqlstate 42S02) (CallerID: t2hlc4pokphxefi4cot1): Sql: "select projectx_connectors.id, projectx_connectors.name, projectx_connectors.logo_url, projectx_connectors.status, projectx_connectorConfigs.env, projectx_connectorConfigs.secret from projectx_connectors left join projectx_connectorConfigs on projectx_connectors.id = projectx_connectorConfigs.connector_id", BindVars: {REDACTED}

This error appears to directly relate to the runtime error previously described, reinforcing the issue with the projectx_connectors table's absence in the database.

Discussion:

This additional detail suggests that the problem is not isolated to a specific operation but affects general application functionality, further emphasizing the need for a resolution to ensure the projectx_connectors table exists as expected in the database schema.

Steps to Reproduce:

  1. Navigate to Settings -> Connectors in the application UI.
  2. The runtime error is triggered, indicating the absence of the projectx_connectors table.

Potential Causes:

  • The drizzle-kit error may be related to handling schema changes, especially around column operations in the presence of serial data types.
  • The runtime error could be due to a discrepancy between the expected schema in the application and the actual schema present in the database, specifically the absence of the projectx_connectors table.

Requested Assistance:

  • For Issue 1, guidance on resolving the TypeError during drizzle-kit operations, possibly related to schema change processing.
  • For Issue 2, steps to ensure the projectx_connectors table exists as expected or how to handle its absence without triggering runtime errors.

Thank you for looking into these issues. Any insights or suggestions on resolving these errors would be greatly appreciated.

Codehagen avatar Feb 14 '24 06:02 Codehagen

It is still a draft PR, and the tRPC error will go away once the migrations are completed successfully ;)

matteobad avatar Feb 14 '24 08:02 matteobad

Sounds good, maybe just me that is eager to push the product ✨

Codehagen avatar Feb 14 '24 09:02 Codehagen

Sounds good, maybe just me that is eager to push the product ✨

I'm eager too 🦾

matteobad avatar Feb 14 '24 10:02 matteobad