Skip to content

Conversation

@jcortes
Copy link
Collaborator

@jcortes jcortes commented Nov 3, 2025

WHY

Resolves #18936

Summary by CodeRabbit

  • New Features
    • Added a Freshchat action to list messages in a conversation, supporting optional from-time filtering and a configurable maximum for paginated retrieval.
  • Chores
    • Bumped Freshchat component version to 0.2.0.

@jcortes jcortes self-assigned this Nov 3, 2025
@vercel
Copy link

vercel bot commented Nov 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Nov 5, 2025 2:34pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Nov 5, 2025 2:34pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 3, 2025

Walkthrough

Adds a new Freshchat action that lists messages in a conversation (supports fromTime and maxResults) and bumps the component package version.

Changes

Cohort / File(s) Summary
New Freshchat List Messages Action
components/freshchat/actions/list-messages/list-messages.mjs
Adds a default export action (key: "freshchat-list-messages") with props app, userId, conversationId (dependent on userId), fromTime, maxResults. run uses app.getPaginatedResults({ fn: app.listMessages, args: { conversation_id, from_time } }), returns the full response and exports a summary count.
Package version bump
components/freshchat/package.json
Increments version from 0.1.1 to 0.2.0 in the component manifest.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Action as Freshchat List Messages Action
  participant Runtime as Platform Runtime
  participant App as Freshchat App SDK
  participant API as Freshchat API

  User->>Action: invoke run({ conversationId, fromTime, maxResults })
  Action->>Runtime: call getPaginatedResults(fn: app.listMessages, args)
  Runtime->>App: listMessages(args: { conversation_id, from_time, ... })
  App->>API: HTTP request to /messages (paginated)
  API-->>App: paginated message pages
  App-->>Runtime: aggregated results
  Runtime-->>Action: messages array
  Action-->>User: return full response + summary (message_count, ...)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify conversationId / userId prop dependency and validation.
  • Confirm fromTime is correctly mapped to from_time and maxResults limits pagination as intended.
  • Check exported metadata (key, annotations, version) follow project conventions.

Pre-merge checks and finishing touches

❌ Failed checks (2 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is vague and overly broad. It states 'new component' without specifying which action or functionality is being added. Specify the primary action in the title, e.g., '[Components] FreshChat - List messages in conversation' to clearly convey the main change.
Description check ❓ Inconclusive The description is minimal and only references the linked issue without explaining what was added or why. Expand the description to explain what functionality was added (e.g., new action to list messages) and how it works.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes implement the required FreshChat action to list messages in a conversation as specified in issue #18936.
Out of Scope Changes check ✅ Passed All changes are scoped to adding the list-messages action and updating the package version, which are directly related to issue #18936.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch freshchat-new-component

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 54869dd and c8ba2ff.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • components/freshchat/actions/list-messages/list-messages.mjs (1 hunks)
  • components/freshchat/package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream 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`.

Applied to files:

  • components/freshchat/actions/list-messages/list-messages.mjs
📚 Learning: 2025-07-09T18:07:12.426Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 17538
File: components/aircall/sources/new-sms/new-sms.mjs:19-25
Timestamp: 2025-07-09T18:07:12.426Z
Learning: In Aircall API webhook payloads, the `created_at` field is returned as an ISO 8601 string format (e.g., "2020-02-18T20:52:22.000Z"), not as milliseconds since epoch. For Pipedream components, this needs to be converted to milliseconds using `Date.parse()` before assigning to the `ts` field in `generateMeta()`.

Applied to files:

  • components/freshchat/actions/list-messages/list-messages.mjs
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.

Applied to files:

  • components/freshchat/package.json
⏰ 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: Lint Code Base
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (7)
components/freshchat/package.json (1)

3-3: LGTM! Appropriate version bump for new action.

The minor version bump from 0.1.1 to 0.2.0 is appropriate for adding a new action to the component.

components/freshchat/actions/list-messages/list-messages.mjs (6)

1-2: LGTM! Standard import structure.

The import statement correctly references the parent app module.


3-13: LGTM! Metadata and annotations are appropriate.

The action metadata correctly describes the operation, and the annotations properly indicate this is a read-only, non-destructive action.


14-30: LGTM! Props are well-structured with proper dependencies.

The userId and conversationId props are correctly configured with appropriate propDefinitions, and the dependency chain (conversationId depends on userId) is properly implemented.


31-36: LGTM! ISO 8601 example added as requested.

The fromTime prop now includes a clear ISO 8601 format example, addressing the feedback from previous review discussions.


37-43: LGTM! Standard maxResults prop configuration.

The maxResults prop correctly uses propDefinition from the app for consistent pagination control.


44-67: Code is correct—no action needed.

Axios automatically omits undefined parameter values when building query strings, so passing from_time: undefined in the params object is safe. The framework filters it out before sending to the API. The current implementation is correct and follows the established pattern used consistently across other freshchat actions (list-agents, list-channels, etc.). The suggested conditional wrapping is unnecessary.

Likely an incorrect or invalid review comment.


Comment @coderabbitai help to get the list of available commands and usage tips.

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: 0

🧹 Nitpick comments (1)
components/freshchat/actions/list-messages/list-messages.mjs (1)

31-36: Consider adding a format example for fromTime.

The description mentions ISO 8601 format, but providing an example would improve usability.

Apply this diff to add a format example:

     fromTime: {
       type: "string",
       label: "From Time",
-      description: "UTC datetime to retrieve messages after this timestamp (ISO 8601 format)",
+      description: "UTC datetime to retrieve messages after this timestamp (ISO 8601 format, e.g., `2025-11-03T21:18:06Z`)",
       optional: true,
     },
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7e653f2 and 8f82abb.

📒 Files selected for processing (1)
  • components/freshchat/actions/list-messages/list-messages.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream 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`.

Applied to files:

  • components/freshchat/actions/list-messages/list-messages.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
🔇 Additional comments (2)
components/freshchat/actions/list-messages/list-messages.mjs (2)

3-13: LGTM! Metadata and annotations are well-configured.

The action metadata is properly structured with appropriate annotations for a read-only list operation.


44-67: LGTM! The run method is correctly implemented.

The implementation properly:

  • Handles parameter conversion from camelCase to snake_case (fromTimefrom_time)
  • Uses pagination via getPaginatedResults
  • Exports a clear summary message
  • Returns the full response

The code aligns with the PR objectives to retrieve conversation history using conversation_id.

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8f82abb and 54869dd.

📒 Files selected for processing (2)
  • components/freshchat/actions/list-messages/list-messages.mjs (1 hunks)
  • components/freshchat/package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.

Applied to files:

  • components/freshchat/package.json
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream 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`.

Applied to files:

  • components/freshchat/actions/list-messages/list-messages.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: Verify TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (3)
components/freshchat/package.json (1)

3-3: LGTM! Appropriate version bump.

The minor version bump from 0.1.1 to 0.2.0 correctly reflects the addition of a new action to the component.

components/freshchat/actions/list-messages/list-messages.mjs (2)

1-13: LGTM! Well-structured action metadata.

The action definition follows Pipedream conventions with appropriate annotations for a read-only list operation. The documentation link and metadata are correctly configured.


52-63: Code verified as correct.

The Freshchat API list messages endpoint accepts from_time as a query parameter, and the response includes a messages array and pagination object. The implementation correctly:

  • Uses resourceKey: "messages" to access the messages array
  • Passes from_time in the params object
  • Relies on the paginate() method's proper handling of the pagination metadata

No issues found. The code follows the API specification correctly.

Copy link
Collaborator

@GTFalcao GTFalcao left a comment

Choose a reason for hiding this comment

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

One description improvement we could make, but moving it to QA nonetheless

@vunguyenhung
Copy link
Collaborator

Hi everyone, all test cases are passed! Ready for release!

Test reports

@jcortes jcortes force-pushed the freshchat-new-component branch from 54869dd to c8ba2ff Compare November 5, 2025 14:34
@jcortes
Copy link
Collaborator Author

jcortes commented Nov 5, 2025

/approve

@jcortes jcortes merged commit a75bf0c into master Nov 5, 2025
10 checks passed
@jcortes jcortes deleted the freshchat-new-component branch November 5, 2025 15:40
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.

[ACTION] Freshchat - List messages in conversation

4 participants