Skip to content

Remove Truncation from URL Handling (Version 0.8.61)#970

Merged
Niyibitanga merged 1 commit intomasterfrom
ninosa/UrlUpdate
Apr 16, 2026
Merged

Remove Truncation from URL Handling (Version 0.8.61)#970
Niyibitanga merged 1 commit intomasterfrom
ninosa/UrlUpdate

Conversation

@Niyibitanga
Copy link
Copy Markdown
Contributor

@Niyibitanga Niyibitanga commented Oct 31, 2025

Move truncation to backend

@Niyibitanga Niyibitanga requested a review from Copilot October 31, 2025 18:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new keep configuration option to preserve specific URL query parameters from being truncated during URL scrubbing. The feature reorders query strings to move "kept" parameters to the front, ensuring they remain within the maxUrlLength limit when truncation occurs.

Key changes:

  • Added keep parameter to the Config interface alongside existing drop parameter
  • Implemented logic to reorder query parameters, placing kept parameters first
  • Initialized default keep configuration as an empty array

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/clarity-js/types/core.d.ts Added keep?: string[] to Config interface
packages/clarity-js/src/core/config.ts Initialized default keep configuration as empty array
packages/clarity-js/src/core/scrub.ts Implemented query parameter reordering logic to prioritize kept parameters before truncation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/clarity-js/src/core/scrub.ts Outdated
Comment thread packages/clarity-js/src/core/scrub.ts Outdated
@Niyibitanga Niyibitanga requested a review from Copilot October 31, 2025 18:41
@Niyibitanga Niyibitanga marked this pull request as ready for review October 31, 2025 18:41
@Niyibitanga Niyibitanga changed the title Ninosa/url update Update Url Processing Oct 31, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/clarity-js/src/core/scrub.ts Outdated
Comment thread packages/clarity-js/src/core/scrub.ts
Comment thread packages/clarity-js/src/core/scrub.ts
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.

Comment thread packages/clarity-js/src/core/scrub.ts Outdated
Comment thread packages/clarity-js/src/core/scrub.ts Outdated
Comment thread packages/clarity-js/src/core/scrub.ts Outdated
Comment thread packages/clarity-js/src/core/scrub.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 17 comments.

Comment thread packages/clarity-js/test/scrub.test.ts Outdated
Comment thread packages/clarity-js/test/scrub.test.ts Outdated
Comment thread packages/clarity-js/src/core/scrub.ts Outdated
Comment thread packages/clarity-js/test/scrub.test.ts Outdated
Comment thread packages/clarity-js/src/core/scrub.ts Outdated
Comment thread packages/clarity-js/src/core/scrub.ts Outdated
Comment thread packages/clarity-js/src/core/scrub.ts Outdated
Comment thread packages/clarity-js/src/core/scrub.ts Outdated
Comment thread packages/clarity-js/src/core/scrub.ts
Comment thread packages/clarity-js/src/core/scrub.ts Outdated
Comment thread packages/clarity-js/test/scrub.test.ts Fixed
Comment thread packages/clarity-js/src/core/scrub.ts Outdated
@Niyibitanga Niyibitanga changed the title Update Url Processing Move truncation, to backend Feb 24, 2026
@Niyibitanga Niyibitanga changed the title Move truncation, to backend Move truncation to backend Feb 24, 2026
@Niyibitanga Niyibitanga requested a review from Copilot February 24, 2026 23:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

packages/clarity-js/src/core/scrub.ts:96

  • The new comment references "Decode/Utils/UrlPreserver.cs", but there’s no such file/path in this repo (including packages/clarity-decode). This makes the source-of-truth for truncation hard to verify/maintain here; consider rewording to a repo-agnostic note (e.g., "handled server-side") or linking to the specific backend/decoder repo/location if it’s external.
// Truncation is now handled server-side in Decode/Utils/UrlPreserver.cs.
export function url(input: string, electron: boolean = false): string {

Comment thread packages/clarity-js/src/data/envelope.ts Outdated
Comment thread packages/clarity-js/src/data/envelope.ts Outdated
@Niyibitanga Niyibitanga changed the title Move truncation to backend Move URL truncation to backend Feb 24, 2026
Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 25, 2026

@Niyibitanga I've opened a new pull request, #1043, to work on those changes. Once the pull request is ready, I'll request review from you.

@Niyibitanga Niyibitanga changed the title Move URL truncation to backend Remove Truncation from URL Handling Feb 25, 2026
@Niyibitanga Niyibitanga force-pushed the ninosa/UrlUpdate branch 4 times, most recently from 4647750 to 0af4f28 Compare April 15, 2026 22:41
@Niyibitanga Niyibitanga merged commit bd015ba into master Apr 16, 2026
5 checks passed
@Niyibitanga Niyibitanga changed the title Remove Truncation from URL Handling Remove Truncation from URL Handling (Version 0.8.61) Apr 16, 2026
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.

7 participants