Skip to content

[BUG] 403 error when trying to create a simple text post in LinkedIn #17829

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 4, 2025

Conversation

jcortes
Copy link
Collaborator

@jcortes jcortes commented Jul 28, 2025

WHY

Resolves #17723

Summary by CodeRabbit

  • New Features
    • Improved LinkedIn post creation actions for users and organizations by dynamically retrieving author IDs and explicitly setting post lifecycle state and feed distribution.
  • Bug Fixes
    • Enhanced reliability of LinkedIn text and image post actions by ensuring correct author URN formatting and response handling.
  • Chores
    • Updated version numbers for multiple LinkedIn actions and components.
    • Streamlined LinkedIn app post creation method for consistency.

@jcortes jcortes self-assigned this Jul 28, 2025
Copy link

vercel bot commented Jul 28, 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) Visit Preview Aug 1, 2025 9:14pm
pipedream-docs ⬜️ Ignored (Inspect) Aug 1, 2025 9:14pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Aug 1, 2025 9:14pm

Copy link
Contributor

coderabbitai bot commented Jul 28, 2025

Walkthrough

This change updates several LinkedIn integration components. Most files only have version number increments. However, the post creation actions for users and organizations are updated to explicitly set the author as a URN, include lifecycleState: "PUBLISHED", and specify distribution.feedDistribution: "MAIN_FEED". The createPost method in the LinkedIn app is refactored to simplify argument handling.

Changes

Cohort / File(s) Change Summary
Version Bumps Only
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/get-org-member-access/get-org-member-access.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/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/sources/new-organization-post-created/new-organization-post-created.mjs, components/linkedin/package.json
Incremented version numbers in metadata or package.json only; no functional or logic changes.
LinkedIn App Refactor
components/linkedin/linkedin.app.mjs
Refactored the createPost method: removed internal construction of the data payload and author URN logic; now directly passes all arguments to _makeRequest. Changed method signature to accept a single args object.
Image Post (Organization)
components/linkedin/actions/create-image-post-organization/create-image-post-organization.mjs
Updated payload to use fully qualified organization URN for author, added lifecycleState: "PUBLISHED" and distribution.feedDistribution: "MAIN_FEED" fields. Version incremented.
Image Post (User)
components/linkedin/actions/create-image-post-user/create-image-post-user.mjs
Now fetches current user profile to set author as person URN, adds lifecycleState and distribution fields to post data, and increments version.
Text Post (Organization)
components/linkedin/actions/create-text-post-organization/create-text-post-organization.mjs
Changed author field to organization URN, added lifecycleState and distribution fields, updated return logic, and incremented version.
Text Post (User)
components/linkedin/actions/create-text-post-user/create-text-post-user.mjs
Fetches current user profile to set author as person URN, adds lifecycleState and distribution fields, updates payload construction, and modifies return value logic. Version incremented.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Action
    participant LinkedInApp
    participant LinkedInAPI

    User->>Action: Trigger create-text-post-user
    Action->>LinkedInApp: getCurrentMemberProfile()
    LinkedInApp-->>Action: Return user profile (id)
    Action->>LinkedInApp: createPost({ author: urn:li:person:{id}, lifecycleState, distribution, ... })
    LinkedInApp->>LinkedInAPI: POST /posts with payload
    LinkedInAPI-->>LinkedInApp: Response
    LinkedInApp-->>Action: Response
    Action-->>User: Success or error
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Assessment against linked issues

Objective Addressed Explanation
Fix 403 error when creating a simple LinkedIn text post (#17723)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes found.

Suggested reviewers

  • lcaresia

Poem

A bunny hopped through LinkedIn code,
Tidied versions, lightened the load.
Posts now know just who you are—
With URNs shining like a star!
Bugs chased off, the feed will sing,
As carrots dance—let updates spring! 🥕✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between fddafd1 and c2db2e7.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 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 (3 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-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-org-member-access/get-org-member-access.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/linkedin.app.mjs (1 hunks)
  • components/linkedin/package.json (1 hunks)
  • components/linkedin/sources/new-organization-post-created/new-organization-post-created.mjs (1 hunks)
✅ Files skipped from review due to trivial changes (9)
  • components/linkedin/actions/get-member-profile/get-member-profile.mjs
  • components/linkedin/actions/retrieve-comments-shares/retrieve-comments-shares.mjs
  • components/linkedin/actions/get-multiple-member-profiles/get-multiple-member-profiles.mjs
  • components/linkedin/actions/get-organization-administrators/get-organization-administrators.mjs
  • components/linkedin/actions/search-organization/search-organization.mjs
  • components/linkedin/actions/create-like-on-share/create-like-on-share.mjs
  • components/linkedin/actions/create-comment/create-comment.mjs
  • components/linkedin/actions/retrieve-comments-on-comments/retrieve-comments-on-comments.mjs
  • components/linkedin/sources/new-organization-post-created/new-organization-post-created.mjs
🚧 Files skipped from review as they are similar to previous changes (12)
  • components/linkedin/actions/get-org-member-access/get-org-member-access.mjs
  • components/linkedin/actions/get-organization-access-control/get-organization-access-control.mjs
  • components/linkedin/actions/fetch-ad-account/fetch-ad-account.mjs
  • components/linkedin/actions/delete-post/delete-post.mjs
  • components/linkedin/package.json
  • components/linkedin/actions/get-current-member-profile/get-current-member-profile.mjs
  • 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/linkedin.app.mjs
  • components/linkedin/actions/create-text-post-user/create-text-post-user.mjs
  • components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs
  • components/linkedin/actions/create-text-post-organization/create-text-post-organization.mjs
⏰ 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). (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-linkedin-create-post

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 generate unit tests to generate unit tests for 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.

@jcortes jcortes force-pushed the fix-linkedin-create-post branch from 832b67d to fddafd1 Compare July 28, 2025 20:55
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: 1

🔭 Outside diff range comments (1)
components/linkedin/actions/create-text-post-organization/create-text-post-organization.mjs (1)

31-48: Payload now incomplete after linkedin.app.createPost refactor

linkedin.app.mjs no longer augments the payload, so this action must now provide the full Posts API body.
Currently missing mandatory fields:

  • lifecycleState: "PUBLISHED"
  • distribution: { feedDistribution: "MAIN_FEED" }
  • author should be a URN (e.g. urn:li:organization:${id}), not the raw numeric ID.

Without these, LinkedIn returns HTTP 403/422.

-    const data = {
-      author: this.organizationId,
-      commentary: utils.escapeText(this.text),
-      visibility: "PUBLIC",
-    };
+    const data = {
+      author: `urn:li:organization:${this.organizationId}`,
+      lifecycleState: "PUBLISHED",
+      distribution: {
+        feedDistribution: "MAIN_FEED",
+      },
+      specificContent: {
+        "com.linkedin.ugc.ShareContent": {
+          shareCommentary: {
+            text: utils.escapeText(this.text),
+          },
+          shareMediaCategory: this.article ? "ARTICLE" : "NONE",
+          ...(this.article && {
+            media: [
+              {
+                status: "READY",
+                originalUrl: this.article,
+              },
+            ],
+          }),
+        },
+      },
+      visibility: "PUBLIC",
+    };

Please adjust and retest to ensure the 403 is resolved for organizations as well.

🧹 Nitpick comments (3)
components/linkedin/actions/create-comment/create-comment.mjs (1)

7-7: Version bump looks good – remember to sync docs/changelog.

No functional diff besides the metadata increment to 0.1.8. Ensure the package‐level changelog and any public docs reflect this new action version so users can track the change.

components/linkedin/package.json (1)

3-4: Package version updated but changelog entry missing

Bumping to 1.2.1 is fine, but please ensure the package-level CHANGELOG (if maintained) is updated so downstream consumers understand what changed in this release.

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

18-20: Typo in description

OrgainizationOrganization

-      description: "You can get the Orgainization Vanity Name from the company LinkedIN URL, for example, if the company LinkedIn URL is `https://www.linkedin.com/company/confluent`, then the Organization Vanity Name is `confluent`.",
+      description: "You can get the Organization Vanity Name from the company LinkedIn URL. For example, if the URL is `https://www.linkedin.com/company/confluent`, the Organization Vanity Name is `confluent`.",
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 28e91bb and fddafd1.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 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 (1 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-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-org-member-access/get-org-member-access.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/linkedin.app.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 (10)
components/linkedin/actions/get-member-profile/get-member-profile.mjs (1)

Learnt from: jcortes
PR: #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/fetch-ad-account/fetch-ad-account.mjs (1)

Learnt from: jcortes
PR: #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: #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-comment/create-comment.mjs (1)

Learnt from: jcortes
PR: #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: #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/get-current-member-profile/get-current-member-profile.mjs (1)

Learnt from: jcortes
PR: #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/search-organization/search-organization.mjs (1)

Learnt from: jcortes
PR: #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-image-post-organization/create-image-post-organization.mjs (1)

Learnt from: jcortes
PR: #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 (3)

Learnt from: GTFalcao
PR: #12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the run method of an action, ensure the message is correctly formatted. For example, in the hackerone-get-members action, the correct format is Successfully retrieved ${response.data.length} members.

Learnt from: GTFalcao
PR: #12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the run method of an action, ensure the message is correctly formatted. For example, in the hackerone-get-members action, the correct format is Successfully retrieved ${response.data.length} members.

Learnt from: jcortes
PR: #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-image-post-user/create-image-post-user.mjs (1)

Learnt from: jcortes
PR: #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".

🧬 Code Graph Analysis (1)
components/linkedin/actions/create-text-post-user/create-text-post-user.mjs (1)
components/linkedin/actions/get-current-member-profile/get-current-member-profile.mjs (1)
  • response (13-15)
⏰ 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: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (20)
components/linkedin/actions/get-organization-access-control/get-organization-access-control.mjs (1)

7-7: Version bump LGTM
Incrementing version to 0.2.2 without logic changes is fine. Ensure the CHANGELOG reflects this.

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

7-7: Minor metadata update acknowledged
version: "0.1.8" is consistent with other LinkedIn actions in this PR. No further action required.

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

8-8: Version increment noted
0.0.3 correctly bumps the action without altering behavior. Confirm docs are updated accordingly.

components/linkedin/actions/delete-post/delete-post.mjs (1)

7-7: Metadata bump accepted
version update to 0.0.8 is straightforward and harmonious with the release series.

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

7-7: Aligned version bump
Raising to 0.1.8 keeps versioning uniform; no code issues identified.

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

7-7: Consistent version update acknowledged.

The minor bump to 0.1.8 keeps this action aligned with the rest of the LinkedIn package. Nothing else to flag.

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

7-7: Minor version increment accepted.

0.1.8 matches the coordinated release. Good to go.

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

7-7: Version bump verified.

No behavioral changes accompany this update; metadata only. 👍

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

7-7: Version aligns with package update.

The shift to 0.1.8 is consistent. No further action required.

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

7-8: Version bump looks good

The version alignment keeps this action in sync with the rest of the LinkedIn package. No functional changes detected.

components/linkedin/actions/get-org-member-access/get-org-member-access.mjs (1)

7-8: LGTM on straight version bump

Nothing else changed – safe update.

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

7-7: LGTM! Version increment supports the overall fix.

This version increment aligns with the broader LinkedIn action updates. This action plays a crucial role in resolving the 403 error by providing the current member profile data that other post creation actions now use to properly set the author URN.

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

7-7: LGTM! Coordinated version increment.

This version increment is part of the coordinated maintenance update across LinkedIn action components.

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

10-10: LGTM! Version increment reflects important functional changes.


88-98: Excellent fix for the 403 error issue!

These changes directly address the LinkedIn 403 authorization error by:

  1. Dynamic profile fetching: Using getCurrentMemberProfile() ensures the correct LinkedIn member ID is obtained at runtime
  2. Proper URN formatting: Setting author as urn:li:person:${id} instead of using the OAuth UID directly
  3. Required metadata: Adding lifecycleState: "PUBLISHED" and distribution.feedDistribution: "MAIN_FEED" provides the complete post structure LinkedIn expects

This approach is more robust than relying on the OAuth UID and should resolve the authorization issues users were experiencing.

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

10-10: LGTM! Version increment reflects important functional changes.


90-94: Excellent consistency with user post action!

These changes mirror the improvements made in the user post action:

  1. Proper URN formatting: Author set as urn:li:organization:${this.organizationId}
  2. Required metadata: Adding lifecycleState: "PUBLISHED" and distribution.feedDistribution: "MAIN_FEED"

This consistent approach across user and organization post actions ensures the 403 error fix works for both contexts.

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

8-8: LGTM! Version increment reflects the critical 403 error fix.


67-69: Good defensive programming with fallback return value.

The fallback { success: true } ensures the action doesn't return undefined if the LinkedIn API response is falsy, which improves reliability.

components/linkedin/linkedin.app.mjs (1)

160-166: createPost refactor is safe—no action needed

All callers still await the promise returned by createPost, so dropping the async keyword does not change its behavior. Each LinkedIn action component now builds the full payload—including author, lifecycleState: "PUBLISHED", and distribution.feedDistribution: "MAIN_FEED"—before invoking createPost. No callers rely on in-method payload construction, and all necessary fields are present in:

  • components/linkedin/actions/create-text-post-organization
  • components/linkedin/actions/create-text-post-user
  • components/linkedin/actions/create-image-post-organization
  • components/linkedin/actions/create-image-post-user

michelle0927
michelle0927 previously approved these changes Jul 29, 2025
Copy link
Collaborator

@michelle0927 michelle0927 left a comment

Choose a reason for hiding this comment

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

LGTM!

@jcortes jcortes merged commit 7e68cee into master Aug 4, 2025
11 checks passed
@jcortes jcortes deleted the fix-linkedin-create-post branch August 4, 2025 14:47
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] 403 error when trying to create a simple text post in LinkedIn
2 participants