Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Jul 14, 2025

Resolves #17353

Summary by CodeRabbit

  • New Features

    • Added automatic text escaping for special characters when creating LinkedIn posts, improving content handling and formatting.
  • Improvements

    • Updated descriptions for several LinkedIn actions for improved clarity.
    • Incremented version numbers across multiple LinkedIn actions and package metadata for better version tracking.
  • Bug Fixes

    • Enhanced post creation actions to safely process special characters in post content.

@vercel
Copy link

vercel bot commented Jul 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Jul 14, 2025 3:52pm
pipedream-docs ⬜️ Ignored (Inspect) Jul 14, 2025 3:52pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jul 14, 2025 3:52pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 14, 2025

Walkthrough

The changes introduce a new escapeText utility to handle special character escaping in LinkedIn post actions. This function is applied to the commentary field in all relevant post creation actions. Additionally, version numbers and some descriptions are updated across multiple LinkedIn action files.

Changes

Files/Group Change Summary
components/linkedin/actions/create-comment/create-comment.mjs
components/linkedin/actions/create-like-on-share/create-like-on-share.mjs
components/linkedin/actions/delete-post/delete-post.mjs
components/linkedin/actions/fetch-ad-account/fetch-ad-account.mjs
components/linkedin/actions/get-current-member-profile/get-current-member-profile.mjs
components/linkedin/actions/get-member-profile/get-member-profile.mjs
components/linkedin/actions/get-multiple-member-profiles/get-multiple-member-profiles.mjs
components/linkedin/actions/retrieve-comments-on-comments/retrieve-comments-on-comments.mjs
components/linkedin/actions/retrieve-comments-shares/retrieve-comments-shares.mjs
components/linkedin/actions/search-organization/search-organization.mjs
components/linkedin/actions/get-member-organization-access-control/get-member-organization-access-control.mjs
components/linkedin/actions/get-organization-access-control/get-organization-access-control.mjs
components/linkedin/actions/get-organization-administrators/get-organization-administrators.mjs
components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs
components/linkedin/sources/new-organization-post-created/new-organization-post-created.mjs
Version number increment only; no logic or structural changes.
components/linkedin/actions/create-image-post-organization/create-image-post-organization.mjs
components/linkedin/actions/create-image-post-user/create-image-post-user.mjs
components/linkedin/actions/create-text-post-organization/create-text-post-organization.mjs
components/linkedin/actions/create-text-post-user/create-text-post-user.mjs
Import utils and apply escapeText to commentary field; update version and minor description tweaks.
components/linkedin/common/utils.mjs New escapeText utility function implemented and exported.
components/linkedin/package.json Package version updated from 1.1.0 to 1.1.1.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant LinkedInAction
    participant Utils

    User->>LinkedInAction: Submit post with text (may include special chars)
    LinkedInAction->>Utils: escapeText(text)
    Utils-->>LinkedInAction: Escaped text
    LinkedInAction->>LinkedIn API: Send post with escaped commentary
Loading

Assessment against linked issues

Objective Addressed Explanation
Ensure special characters (e.g., parentheses) in LinkedIn post text are properly escaped (#17353)

Poem

A bunny hops with nimble feet,
Escaping chars so posts are neat.
Parentheses, stars, and curly braces—
Now all survive in LinkedIn spaces!
With every hop, a bug is squashed,
The code is clean, the posts are washed.
🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

components/linkedin/actions/create-image-post-user/create-image-post-user.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

components/linkedin/actions/create-image-post-organization/create-image-post-organization.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

components/linkedin/actions/delete-post/delete-post.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

  • 17 others
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@michelle0927 michelle0927 marked this pull request as ready for review July 14, 2025 15:53
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

♻️ Duplicate comments (3)
components/linkedin/actions/get-member-profile/get-member-profile.mjs (1)

7-7: Same remark as previous file

Ensure the 0.1.7 bump is mirrored in package metadata / changelog.

components/linkedin/actions/retrieve-comments-on-comments/retrieve-comments-on-comments.mjs (1)

7-7: Same remark as previous file

Ensure the 0.1.7 bump is mirrored in package metadata / changelog.

components/linkedin/actions/get-current-member-profile/get-current-member-profile.mjs (1)

7-7: Same remark as previous file

Ensure the 0.1.7 bump is mirrored in package metadata / changelog.

🧹 Nitpick comments (8)
components/linkedin/actions/delete-post/delete-post.mjs (1)

7-7: Version bump acknowledged—remember supporting artifacts

The increment to 0.0.7 is fine.
Double-check that:

  1. components/linkedin/package.json (or monorepo equivalent) reflects the same version set, and
  2. CHANGELOG / release notes mention this bump so consumers know nothing but cosmetic changes occurred.
components/linkedin/actions/get-member-organization-access-control/get-member-organization-access-control.mjs (1)

7-7: Minor semantic-version bump—verify consistency

Going from 1.0.01.0.1 signals a patch change.
Confirm that no breaking changes slipped in elsewhere and that the root package.json & docs show 1.0.1.

components/linkedin/actions/get-multiple-member-profiles/get-multiple-member-profiles.mjs (1)

7-7: Remember to update the public changelog
Consider adding a brief entry summarizing the escape-character fix that motivated this release so users can trace the reason for 0.1.7.

components/linkedin/actions/fetch-ad-account/fetch-ad-account.mjs (1)

7-7: Changelog entry recommended
Add a bullet to the LinkedIn integration changelog to maintain transparency on this release.

components/linkedin/actions/retrieve-comments-shares/retrieve-comments-shares.mjs (1)

7-7: Ensure docs stay in sync
Double-check that any external docs/examples reference the new version where applicable.

components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs (1)

8-8: Consider semantic versioning clarity
If the only change is escaping characters elsewhere, confirm whether this action truly needs a new version; otherwise note rationale in changelog.

components/linkedin/actions/create-like-on-share/create-like-on-share.mjs (1)

7-7: Synchronize release notes
Document this action’s bump alongside others to avoid confusion for downstream users.

components/linkedin/common/utils.mjs (1)

51-56: Optimize performance with single regex

Creating a new regex for each character is inefficient. Consider using a single regex with alternation for better performance.

Apply this diff to optimize the implementation:

 function escapeText(text) {
+  if (!text || typeof text !== 'string') {
+    return text;
+  }
-  const chars = [
-    "\\",
-    "|",
-    "{",
-    "}",
-    "@",
-    "[",
-    "]",
-    "(",
-    ")",
-    "<",
-    ">",
-    "#",
-    "*",
-    "_",
-    "~",
-  ];
-  for (const char of chars) {
-    const escapedChar = "\\" + char;
-    const regex = new RegExp(`\\${char}`, "g");
-    text = text.replace(regex, escapedChar);
-  }
-  return text;
+  return text.replace(/[\\|{}@\[\]()<>#*_~]/g, '\\$&');
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ecba7c0 and 02fd967.

📒 Files selected for processing (21)
  • components/linkedin/actions/create-comment/create-comment.mjs (1 hunks)
  • components/linkedin/actions/create-image-post-organization/create-image-post-organization.mjs (2 hunks)
  • components/linkedin/actions/create-image-post-user/create-image-post-user.mjs (2 hunks)
  • components/linkedin/actions/create-like-on-share/create-like-on-share.mjs (1 hunks)
  • components/linkedin/actions/create-text-post-organization/create-text-post-organization.mjs (2 hunks)
  • components/linkedin/actions/create-text-post-user/create-text-post-user.mjs (2 hunks)
  • components/linkedin/actions/delete-post/delete-post.mjs (1 hunks)
  • components/linkedin/actions/fetch-ad-account/fetch-ad-account.mjs (1 hunks)
  • components/linkedin/actions/get-current-member-profile/get-current-member-profile.mjs (1 hunks)
  • components/linkedin/actions/get-member-organization-access-control/get-member-organization-access-control.mjs (1 hunks)
  • components/linkedin/actions/get-member-profile/get-member-profile.mjs (1 hunks)
  • components/linkedin/actions/get-multiple-member-profiles/get-multiple-member-profiles.mjs (1 hunks)
  • components/linkedin/actions/get-organization-access-control/get-organization-access-control.mjs (1 hunks)
  • components/linkedin/actions/get-organization-administrators/get-organization-administrators.mjs (1 hunks)
  • components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs (1 hunks)
  • components/linkedin/actions/retrieve-comments-on-comments/retrieve-comments-on-comments.mjs (1 hunks)
  • components/linkedin/actions/retrieve-comments-shares/retrieve-comments-shares.mjs (1 hunks)
  • components/linkedin/actions/search-organization/search-organization.mjs (1 hunks)
  • components/linkedin/common/utils.mjs (1 hunks)
  • components/linkedin/package.json (1 hunks)
  • components/linkedin/sources/new-organization-post-created/new-organization-post-created.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
components/linkedin/actions/create-comment/create-comment.mjs (1)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".
components/linkedin/sources/new-organization-post-created/new-organization-post-created.mjs (1)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.
components/linkedin/actions/fetch-ad-account/fetch-ad-account.mjs (1)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".
components/linkedin/actions/create-text-post-organization/create-text-post-organization.mjs (1)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".
components/linkedin/actions/create-text-post-user/create-text-post-user.mjs (1)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (21)
components/linkedin/actions/get-multiple-member-profiles/get-multiple-member-profiles.mjs (1)

7-7: Version bump looks correct and consistent
Patch version increment to 0.1.7 aligns with the coordinated release across other LinkedIn actions.

components/linkedin/actions/fetch-ad-account/fetch-ad-account.mjs (1)

7-7: Version increment acknowledged
No functional changes detected; patch bump to 0.1.7 approved.

components/linkedin/actions/retrieve-comments-shares/retrieve-comments-shares.mjs (1)

7-7: Patch bump accepted
version field updated to 0.1.7; no further issues.

components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs (1)

8-8: Minor version bump looks fine
0.0.1 → 0.0.2 accurately reflects a non-breaking internal enhancement.

components/linkedin/actions/create-like-on-share/create-like-on-share.mjs (1)

7-7: Patch version update approved
version advanced to 0.1.7; implementation unaffected.

components/linkedin/actions/search-organization/search-organization.mjs (1)

7-7: LGTM: Routine version bump

This version increment is appropriate as part of the coordinated LinkedIn component release.

components/linkedin/common/utils.mjs (1)

33-57: Good implementation of character escaping functionality

The function correctly escapes markdown and formatting characters that could interfere with LinkedIn post rendering. The regex construction properly handles special characters like backslashes and square brackets.

components/linkedin/actions/create-comment/create-comment.mjs (1)

7-7: LGTM: Routine version bump

This version increment is appropriate as part of the coordinated LinkedIn component release.

components/linkedin/actions/get-organization-access-control/get-organization-access-control.mjs (1)

7-7: LGTM: Routine version bump

This version increment is appropriate as part of the coordinated LinkedIn component release.

components/linkedin/sources/new-organization-post-created/new-organization-post-created.mjs (1)

12-12: LGTM: Routine version bump

This version increment is appropriate as part of the coordinated LinkedIn component release.

components/linkedin/actions/get-organization-administrators/get-organization-administrators.mjs (1)

7-7: LGTM - Consistent version bump.

The version increment maintains consistency with the package-wide updates without introducing functional changes.

components/linkedin/package.json (1)

3-3: LGTM - Appropriate package version bump.

The minor version increment correctly reflects the cumulative updates across the LinkedIn actions and utilities.

components/linkedin/actions/create-image-post-organization/create-image-post-organization.mjs (2)

91-91: LGTM - Consistent application of text escaping.

The escapeText function is correctly applied to the commentary field to handle special characters in LinkedIn posts, addressing the PR objective.


4-4: escapeText implementation verified and applied consistently

The escapeText function in components/linkedin/common/utils.mjs correctly prefixes all designated special characters with a backslash. It’s imported and used to sanitize the commentary field in all LinkedIn action files:

  • components/linkedin/actions/create-text-post-user/create-text-post-user.mjs (line 33)
  • components/linkedin/actions/create-image-post-user/create-image-post-user.mjs (line 90)
  • components/linkedin/actions/create-text-post-organization/create-text-post-organization.mjs (line 34)
  • components/linkedin/actions/create-image-post-organization/create-image-post-organization.mjs (line 91)

No further changes required.

components/linkedin/actions/create-image-post-user/create-image-post-user.mjs (1)

4-4: LGTM - Consistent text escaping implementation.

The utils import and escapeText function application follow the same pattern as other LinkedIn post actions, ensuring consistent handling of special characters.

Also applies to: 90-90

components/linkedin/actions/create-text-post-organization/create-text-post-organization.mjs (3)

2-2: LGTM - Consistent text escaping implementation.

The utils import and escapeText function application maintain consistency with other LinkedIn post actions for handling special characters.

Also applies to: 34-34


7-7: Minor improvement in description clarity.

The change from "docs" to "documentation" improves the professional tone of the description.


2-2: All LinkedIn post actions consistently use escapeText

I’ve verified that the four post‐creation actions under components/linkedin/actions/—text and image posts for both users and organizations—now all use utils.escapeText(this.text) for the commentary field and that there are no remaining direct this.text usages. No further changes are needed.

components/linkedin/actions/create-text-post-user/create-text-post-user.mjs (3)

2-2: LGTM: Import added for escapeText utility.

The import statement is correctly structured and necessary for the text escaping functionality.


7-7: LGTM: Description text improved.

Good improvement changing "docs" to "documentation" for better clarity.


8-8: LGTM: Version bumped appropriately.

Version increment is appropriate for the functional changes made.

@vunguyenhung vunguyenhung merged commit 04a102f into master Jul 15, 2025
11 checks passed
@vunguyenhung vunguyenhung deleted the issue-17353 branch July 15, 2025 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Certain characters maybe need to be escaped in LinkedIn actions

4 participants