Open
Conversation
- Introduced `importContactsCommand` to the contacts command module. - Updated command examples to include usage of the new import feature. - Added `tryParsePropertiesJsonObject` utility function for improved JSON parsing, enhancing error handling in `parsePropertiesJson` function.
Contributor
There was a problem hiding this comment.
2 issues found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/commands/contacts/import.ts">
<violation number="1" location="src/commands/contacts/import.ts:70">
P2: CSV validation wrongly depends on the first data row’s email value instead of the header, so a valid import file can be rejected outright.</violation>
</file>
<file name="src/lib/parse-csv.ts">
<violation number="1" location="src/lib/parse-csv.ts:44">
P2: Unquoted `"` characters start quoted parsing mid-field, which can silently shift CSV columns and corrupt imported data.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
| } | ||
|
|
||
| switch (c) { | ||
| case '"': |
Contributor
There was a problem hiding this comment.
P2: Unquoted " characters start quoted parsing mid-field, which can silently shift CSV columns and corrupt imported data.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/lib/parse-csv.ts, line 44:
<comment>Unquoted `"` characters start quoted parsing mid-field, which can silently shift CSV columns and corrupt imported data.</comment>
<file context>
@@ -0,0 +1,72 @@
+ }
+
+ switch (c) {
+ case '"':
+ inQuotes = true;
+ i++;
</file context>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
importContactsCommandto the contacts command module.tryParsePropertiesJsonObjectutility function for improved JSON parsing, enhancing error handling inparsePropertiesJsonfunction.Summary by cubic
Adds a CSV import command to bulk-create contacts and optionally add them to segments. Tightens CSV/JSON validation for clearer errors and smoother imports.
New Features
resend contacts import --file <path> [--segment-id <id>...].email/e-mail; optionalfirst_name,last_name,properties(JSON per cell); header normalization.Bug Fixes
emailheader is missing to prevent invalid records.parsePropertiesJsonrejects non-object/invalid JSON with a clearinvalid_propertieserror (viatryParsePropertiesJsonObject).Written for commit fb6b1d0. Summary will update on new commits.