Skip to content

chore(release): pull main into develop post release v1.111.2 - #4745

Merged
ItsSudip merged 3 commits into
developfrom
main
Nov 3, 2025
Merged

ItsSudip merged 3 commits into
developfrom
main

Conversation

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

👑 An automated PR

ItsSudip and others added 3 commits October 30, 2025 17:22
* fix: remove userid/deviceid level throttler handler for am

* chore: address comment

* chore: update varaible name
@coderabbitai

coderabbitai Bot commented Oct 31, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Refactor
    • Improved internal error handling consistency for network responses. Simplified error processing logic for throttled requests, resulting in more uniform error message generation across scenarios.

Walkthrough

Refactored error handling in the AM destination networkHandler to normalize error extraction and simplify throttling logic. Replaced direct response.error access with a normalized errorResponse variable, removed conditional checks for throttled users/devices in the 429 path, and now consistently throws ThrottledError. No public API changes.

Changes

Cohort / File(s) Change Summary
Error handling and throttling logic refactor
src/v1/destinations/am/networkHandler.ts
Consolidated error extraction into errorResponse variable; removed throttledUsers/throttledDevices conditional checks in 429 path and simplified to always throw ThrottledError; updated AbortedError message to reference errorResponse; standardized error message construction across all error paths.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Areas requiring attention:

  • Verify that removal of throttledUsers/throttledDevices checks does not mask or alter intended throttling behavior—ensure the simplified logic correctly handles all throttling scenarios.
  • Confirm errorResponse extraction and usage is consistent with upstream response structure to avoid null/undefined issues.
  • Validate that the simplified ThrottledError path maintains expected retry semantics and logging.

Possibly related PRs

Suggested reviewers

  • chandumlg
  • ItsSudip
  • koladilip

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The provided description (":crown: An automated PR") is largely incomplete and does not follow the required template structure. It lacks all essential sections including an explanation of changes, Linear task reference, objectives, capability/behaviour documentation, dependency information, technical considerations, and both developer and reviewer checklists. While this is an automated PR, the description should still provide meaningful context about the changes being pulled from main into develop to assist reviewers in understanding the scope and impact of the merge. Consider filling in the PR description template with substantive information about the changes being merged, particularly what modifications are included in v1.111.2 (such as the error handling improvements in networkHandler.ts), any breaking changes, and links to relevant Linear tasks. This will help reviewers understand the scope of the release and ensure proper oversight of the merge into develop.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "chore(release): pull main into develop post release v1.111.2" accurately describes the primary purpose of this PR. It clearly communicates that this is an automated release management PR that merges changes from the main branch (which contain the v1.111.2 release, including the networkHandler.ts error handling refactoring visible in the raw summary) into the develop branch. The title is specific and appropriately scoped for understanding the intent without requiring detailed knowledge of individual code changes.
✨ 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 main

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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/v1/destinations/am/networkHandler.ts (1)

81-87: Reuse the errorMessage variable to eliminate duplication.

Line 83 duplicates the stringification logic from line 38. Since errorMessage is already defined, use it directly to improve maintainability.

Apply this diff:

   throw new AbortedError(
-    `Request Failed during ${DESTINATION} response transformation: with status "${status}" due to "${
-      JSON.stringify(errorResponse) || 'unknown error'
-    }", (Aborted)`,
+    `Request Failed during ${DESTINATION} response transformation: with status "${status}" due to "${errorMessage}", (Aborted)`,
     status,
     destinationResponse,
   );
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 036e531 and 80b80b1.

⛔ Files ignored due to path filters (5)
  • CHANGELOG.md is excluded by !**/*.md
  • package-lock.json is excluded by !**/package-lock.json, !**/*.json
  • package.json is excluded by !**/*.json
  • src/v0/destinations/am/README.md is excluded by !**/*.md
  • test/integrations/destinations/am/dataDelivery/data.ts is excluded by !**/test/**
📒 Files selected for processing (1)
  • src/v1/destinations/am/networkHandler.ts (3 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: ItsSudip
Repo: rudderlabs/rudder-transformer PR: 4654
File: src/v1/destinations/am/networkHandler.ts:50-86
Timestamp: 2025-09-24T10:41:29.258Z
Learning: In the AM destination network handler (src/v1/destinations/am/networkHandler.ts), ItsSudip confirmed that hardcoded status codes (500/400) in RetryableError and AbortedError constructors are acceptable because the actual HTTP status verification happens before setting these codes in the error flow.
Learnt from: ItsSudip
Repo: rudderlabs/rudder-transformer PR: 4707
File: src/v1/destinations/am/networkHandler.ts:0-0
Timestamp: 2025-10-13T03:41:56.503Z
Learning: In the AM destination network handler (src/v1/destinations/am/networkHandler.ts), the populateResponseWithDontBatch function uses conditional status codes: 400 for events that already have metadata.dontBatch=true (meaning they've been retried individually and failed), and 500 for first-time failures (to trigger an unbatched retry). This two-phase retry pattern prevents infinite retries of persistently failing events.
📚 Learning: 2025-09-24T10:41:29.258Z
Learnt from: ItsSudip
Repo: rudderlabs/rudder-transformer PR: 4654
File: src/v1/destinations/am/networkHandler.ts:50-86
Timestamp: 2025-09-24T10:41:29.258Z
Learning: In the AM destination network handler (src/v1/destinations/am/networkHandler.ts), ItsSudip confirmed that hardcoded status codes (500/400) in RetryableError and AbortedError constructors are acceptable because the actual HTTP status verification happens before setting these codes in the error flow.

Applied to files:

  • src/v1/destinations/am/networkHandler.ts
📚 Learning: 2025-10-13T03:41:56.503Z
Learnt from: ItsSudip
Repo: rudderlabs/rudder-transformer PR: 4707
File: src/v1/destinations/am/networkHandler.ts:0-0
Timestamp: 2025-10-13T03:41:56.503Z
Learning: In the AM destination network handler (src/v1/destinations/am/networkHandler.ts), the populateResponseWithDontBatch function uses conditional status codes: 400 for events that already have metadata.dontBatch=true (meaning they've been retried individually and failed), and 500 for first-time failures (to trigger an unbatched retry). This two-phase retry pattern prevents infinite retries of persistently failing events.

Applied to files:

  • src/v1/destinations/am/networkHandler.ts
📚 Learning: 2025-09-24T07:20:21.396Z
Learnt from: ItsSudip
Repo: rudderlabs/rudder-transformer PR: 4654
File: src/v0/destinations/am/config.js:127-128
Timestamp: 2025-09-24T07:20:21.396Z
Learning: For Amplitude destination, MAX_USERS_DEVICES_PER_BATCH = 1000 is correctly set based on Amplitude's throttling limit of 1000 events per second per user/device, not the per-request batch size limit. The batching logic groups events by userId/anonymousId to prevent throttling, which is separate from the AMBatchEventLimit = 500 constraint for individual API requests.

Applied to files:

  • src/v1/destinations/am/networkHandler.ts
⏰ 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). (7)
  • GitHub Check: Code Coverage
  • GitHub Check: test_and_publish
  • GitHub Check: UT Tests
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
src/v1/destinations/am/networkHandler.ts (1)

37-38: LGTM! Error extraction refactoring improves consistency.

The renaming of error to errorResponse and the centralized construction of errorMessage enhance code clarity and maintainability.

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor Author

Allure Test reports for this run are available at:

@codecov

codecov Bot commented Oct 31, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.91%. Comparing base (690dc83) to head (80b80b1).
⚠️ Report is 22 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4745      +/-   ##
===========================================
- Coverage    91.92%   91.91%   -0.02%     
===========================================
  Files          651      651              
  Lines        34609    34613       +4     
  Branches      8121     8131      +10     
===========================================
  Hits         31816    31816              
+ Misses        2563     2548      -15     
- Partials       230      249      +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

Copy link
Copy Markdown

@vinayteki95
vinayteki95 removed the request for review from chandumlg October 31, 2025 11:30
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.

6 participants