-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Fix Airtable URL field asking for object input #14835
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
According to the Airtable docs, the URL field type should be a string, not an object. See: https://airtable.com/developers/extensions/api/FieldType#URL
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
WalkthroughThe pull request includes updates to multiple files within the Changes
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (2)
components/airtable_oauth/sources/new-or-modified-records/new-or-modified-records.mjs (1)
Line range hint
31-31
: Fix typo in fieldIds descriptionThere's a typo in the description: "spedific" should be "specific".
- description: "Identifiers of spedific fields/columns to watch for updates", + description: "Identifiers of specific fields/columns to watch for updates",components/airtable_oauth/actions/search-records/search-records.mjs (1)
Line range hint
89-102
: Consider adding URL validation for URL fieldsWhile the type-based formula generation is good, consider adding specific validation for URL fields to ensure the search value is a valid URL when the field type is URL.
Here's a suggested enhancement:
let filterByFormula = this.searchFormula; if (!this.searchFormula) { const type = fieldTypeToPropType(field.type); + // Special handling for URL fields + if (field.type === FieldType.URL && this.value) { + try { + new URL(this.value); // Validate URL format + } catch (e) { + throw new Error(`Invalid URL format: ${this.value}`); + } + } filterByFormula = type === "string" ? `FIND("${this.value}", {${this.fieldName}})` : type === "boolean"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (27)
components/airtable_oauth/actions/create-comment/create-comment.mjs
(1 hunks)components/airtable_oauth/actions/create-field/create-field.mjs
(1 hunks)components/airtable_oauth/actions/create-multiple-records/create-multiple-records.mjs
(1 hunks)components/airtable_oauth/actions/create-or-update-record/create-or-update-record.mjs
(1 hunks)components/airtable_oauth/actions/create-single-record/create-single-record.mjs
(1 hunks)components/airtable_oauth/actions/create-table/create-table.mjs
(1 hunks)components/airtable_oauth/actions/delete-record/delete-record.mjs
(1 hunks)components/airtable_oauth/actions/get-record-or-create/get-record-or-create.mjs
(1 hunks)components/airtable_oauth/actions/get-record/get-record.mjs
(1 hunks)components/airtable_oauth/actions/list-records-in-view/list-records-in-view.mjs
(1 hunks)components/airtable_oauth/actions/list-records/list-records.mjs
(1 hunks)components/airtable_oauth/actions/search-records/search-records.mjs
(1 hunks)components/airtable_oauth/actions/update-comment/update-comment.mjs
(1 hunks)components/airtable_oauth/actions/update-field/update-field.mjs
(1 hunks)components/airtable_oauth/actions/update-record/update-record.mjs
(1 hunks)components/airtable_oauth/actions/update-table/update-table.mjs
(1 hunks)components/airtable_oauth/common/constants.mjs
(1 hunks)components/airtable_oauth/common/utils.mjs
(1 hunks)components/airtable_oauth/package.json
(1 hunks)components/airtable_oauth/sources/new-field/new-field.mjs
(1 hunks)components/airtable_oauth/sources/new-modified-or-deleted-records-instant/new-modified-or-deleted-records-instant.mjs
(1 hunks)components/airtable_oauth/sources/new-modified-or-deleted-records/new-modified-or-deleted-records.mjs
(1 hunks)components/airtable_oauth/sources/new-or-modified-field/new-or-modified-field.mjs
(1 hunks)components/airtable_oauth/sources/new-or-modified-records-in-view/new-or-modified-records-in-view.mjs
(1 hunks)components/airtable_oauth/sources/new-or-modified-records/new-or-modified-records.mjs
(1 hunks)components/airtable_oauth/sources/new-records-in-view/new-records-in-view.mjs
(1 hunks)components/airtable_oauth/sources/new-records/new-records.mjs
(1 hunks)
✅ Files skipped from review due to trivial changes (20)
- components/airtable_oauth/actions/get-record/get-record.mjs
- components/airtable_oauth/actions/update-record/update-record.mjs
- components/airtable_oauth/common/constants.mjs
- components/airtable_oauth/actions/create-table/create-table.mjs
- components/airtable_oauth/package.json
- components/airtable_oauth/actions/create-single-record/create-single-record.mjs
- components/airtable_oauth/actions/list-records/list-records.mjs
- components/airtable_oauth/actions/update-comment/update-comment.mjs
- components/airtable_oauth/sources/new-modified-or-deleted-records-instant/new-modified-or-deleted-records-instant.mjs
- components/airtable_oauth/actions/create-field/create-field.mjs
- components/airtable_oauth/actions/create-comment/create-comment.mjs
- components/airtable_oauth/sources/new-or-modified-records-in-view/new-or-modified-records-in-view.mjs
- components/airtable_oauth/sources/new-records-in-view/new-records-in-view.mjs
- components/airtable_oauth/sources/new-records/new-records.mjs
- components/airtable_oauth/actions/delete-record/delete-record.mjs
- components/airtable_oauth/actions/create-multiple-records/create-multiple-records.mjs
- components/airtable_oauth/sources/new-or-modified-field/new-or-modified-field.mjs
- components/airtable_oauth/actions/update-table/update-table.mjs
- components/airtable_oauth/sources/new-field/new-field.mjs
- components/airtable_oauth/actions/create-or-update-record/create-or-update-record.mjs
🔇 Additional comments (6)
components/airtable_oauth/actions/get-record-or-create/get-record-or-create.mjs (2)
9-9
: LGTM: Version bump is appropriate
The version increment from "0.0.7" to "0.0.8" follows semantic versioning for bug fixes.
Line range hint 1-58
: Verify the relevance of changes to PR objectives
The PR's main objective is to fix the Airtable URL field prop type, but this file doesn't contain any URL field related changes. Please verify if this file needs to be included in this PR.
Let's search for URL field related changes in the codebase:
components/airtable_oauth/common/utils.mjs (1)
42-42
: Correct change to URL field type mapping
The change from "object" to "string" for FieldType.URL
aligns with Airtable's documentation and is logically correct as URLs are string values.
Let's verify the impact of this change on existing implementations:
✅ Verification successful
Change to URL field type is safe to proceed
The change from "object" to "string" for FieldType.URL
is safe based on the codebase analysis:
-
The
fieldTypeToPropType
function is used in three places:- In search-records action for building search formulas, where URL fields will now use the string-based FIND formula, which is correct
- In the app for filtering fields by type
- In utils.mjs for generating prop definitions
-
The change aligns with how URL fields are actually handled in the search functionality, where they're treated as string values in formulas.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for any direct usage of URL fields in the codebase
rg -l "FieldType\.URL" --type js --type mjs
# Search for potential field type checks or URL field handling
rg -l "field\.type\s*===?\s*['\"]URL['\"]" --type js --type mjs
Length of output: 171
Script:
#!/bin/bash
# Search for any direct usage of URL fields in the codebase, including .mjs files
rg -l "FieldType\.URL" --type-add 'mjs:*.mjs' --type mjs --type js
# Search for potential field type checks or URL field handling
rg -l "field\.type\s*===?\s*['\"]URL['\"]" --type-add 'mjs:*.mjs' --type mjs --type js
# Look for any usage of fieldTypeToPropType function
rg -l "fieldTypeToPropType" --type-add 'mjs:*.mjs' --type mjs --type js
Length of output: 436
Script:
#!/bin/bash
# Check how fieldTypeToPropType is used in the files that import it
rg -A 5 "fieldTypeToPropType" --type-add 'mjs:*.mjs' --type mjs --type js
# Look at the implementation of search-records action to see if it handles URL fields
cat components/airtable_oauth/actions/search-records/search-records.mjs
Length of output: 8523
components/airtable_oauth/actions/search-records/search-records.mjs (1)
8-8
: Version bump is appropriate
The increment to version 0.0.9 is appropriate given the change in URL field type handling.
components/airtable_oauth/actions/update-field/update-field.mjs (1)
8-8
: Verify if version bump corresponds to URL field changes
The version bump to 0.0.7 is present, but the changes related to fixing the Airtable URL field prop type (from object to string) mentioned in the PR description are not visible in this file.
✅ Verification successful
Version bump is consistent with URL field type change
Looking at the code, I can confirm that the version bump is indeed related to the URL field type change. The constants.mjs
file shows that the URL field type is correctly defined as a string type, and the utils.mjs
file confirms that URL fields are properly mapped to string prop types in the fieldTypeToPropType
function. This version bump appears to be part of a coordinated update across multiple components in the airtable_oauth integration.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for URL field type definitions in the codebase
rg -l "URL.*field.*type" --type js
# Search for recent changes related to URL fields
git log -G "URL.*field.*type" --since="1 month ago" --pretty=format:"%h %s" --patch
Length of output: 36
Script:
#!/bin/bash
# Let's try different search patterns to find URL field related code
rg -i "url.*field" --type js -A 2
# Also search for any field type definitions in the component
fd . components/airtable_oauth -e js -e mjs -x rg -l "field.*type"
# Look for changes in the component directory
fd . components/airtable_oauth -e js -e mjs -x rg -l "version.*0\.0\.[67]"
Length of output: 1688
Script:
#!/bin/bash
# Let's check the field type definitions in the common files and create-field action
cat components/airtable_oauth/common/constants.mjs
cat components/airtable_oauth/actions/create-field/create-field.mjs
# Also check the utils file for any field type handling
cat components/airtable_oauth/common/utils.mjs
# Check the app file for field type definitions
cat components/airtable_oauth/airtable_oauth.app.mjs
Length of output: 19744
components/airtable_oauth/actions/list-records-in-view/list-records-in-view.mjs (1)
Line range hint 13-23
: LGTM: Well-structured viewId property definition
The addition of the viewId property is well-structured:
- Properly uses propDefinition from common.props.airtable
- Correctly extracts baseId and tableId from context
- Includes withLabel for better UX
Let's verify the viewId property definition in the common props:
✅ Verification successful
LGTM: The viewId property definition is correctly implemented
The viewId property definition in the code matches the app's propDefinitions:
- It correctly references the viewId from airtable_oauth.app.mjs
- The property accepts baseId and tableId parameters as required by the app's viewId options function
- The implementation properly passes the values needed for view lookup
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the viewId property definition in common props
# Expected: Should find the viewId property definition in common.props.airtable
# Search for viewId definition in common props
ast-grep --pattern 'viewId: {
$$$
}'
# Search for any usage of this property
rg -l 'viewId.*propDefinition.*airtable'
Length of output: 83
Script:
#!/bin/bash
# Let's try a different approach to find the viewId definition and its usage
# Search for files containing "viewId" in the components/airtable_oauth directory
fd . components/airtable_oauth -t f -x rg -l "viewId"
# Search for common props file in airtable directory
fd common.* components/airtable_oauth
# Once we find the common props file, we'll examine its content
fd common.* components/airtable_oauth -x cat {}
# Search for any propDefinition usage with viewId
rg "viewId.*propDefinition" -A 5
Length of output: 4769
Script:
#!/bin/bash
# Let's check the airtable_oauth.app.mjs file since it's likely to contain the propDefinitions
cat components/airtable_oauth/airtable_oauth.app.mjs
# Also let's specifically look for viewId definition in this file
rg "viewId.*:" -A 10 components/airtable_oauth/airtable_oauth.app.mjs
Length of output: 14120
components/airtable_oauth/sources/new-or-modified-records/new-or-modified-records.mjs
Show resolved
Hide resolved
...s/airtable_oauth/sources/new-modified-or-deleted-records/new-modified-or-deleted-records.mjs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for finding and fixing this!
WHY
Additional props (e.g. in the Update Record action) with the
URL
Airtable field type are given a prop type of "object". Based on the Airtable docs, the type should be "string", not "object".Context: https://pipedream-users.slack.com/archives/CMZG4EBJ9/p1733276186749089
Summary by CodeRabbit
Release Notes
New Features
viewId
property for enhanced record retrieval in the listing action.searchMethod
property, allowing users to choose between searching by field and value or by formula.Version Updates
Bug Fixes
fieldIds
property to improve clarity in the new-or-modified-records source.These updates enhance functionality and maintain the stability of existing features.