Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"pg-connection-string": "2.9.1",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The Plaid API can return null for mask and official_name, but the Zod schema expects non-null strings, causing a silent failure when updating accounts.
Severity: MEDIUM

Suggested Fix

In server/lib/plaid/connect.ts, handle potential null values from the Plaid API for account.mask and account.official_name. Coalesce null to an empty string (e.g., account.mask ?? '') before calling transactionsImport.update() to ensure the data conforms to the Zod schema's non-null string requirement.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: package.json#L118

Potential issue: The Plaid API can return `null` for `account.mask` and
`account.official_name`. The code in `server/lib/plaid/connect.ts` unconditionally uses
these values when updating a `transactionsImport`. However, the Zod schema in
`server/models/TransactionsImport.ts` defines `mask` and `officialName` as required,
non-null strings. When `transactionsImport.update()` is called with `null` values, the
validation fails. This error is caught and reported to Sentry, but it silently prevents
the list of available accounts from being updated, meaning users will not see their
accounts after a refresh.

Did we get this right? 👍 / 👎 to inform future reviews.

"pg-format": "1.0.4",
"pg-listen": "1.7.0",
"plaid": "31.1.0",
"plaid": "41.1.0",
"redis": "5.10.0",
"sanitize-html": "2.17.0",
"sequelize": "6.37.7",
Expand Down
Loading