Skip to content

node: reduce breadcrumb size #230

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 14 commits into from
Sep 26, 2024

Conversation

perf2711
Copy link
Contributor

@perf2711 perf2711 commented Mar 5, 2024

Follow up to #228 for Node.

@perf2711 perf2711 added the enhancement New feature or request label Mar 5, 2024
@perf2711 perf2711 requested a review from konraddysput March 5, 2024 16:43
@perf2711 perf2711 self-assigned this Mar 5, 2024
@perf2711 perf2711 force-pushed the feature/BT-718-reduce-breadcrumb-size branch from 6c41841 to 5b03f4d Compare June 25, 2024 11:41
@perf2711 perf2711 force-pushed the feature/BT-718-reduce-breadcrumb-size--node branch from d4409e1 to 8555396 Compare July 12, 2024 15:31
@perf2711 perf2711 force-pushed the feature/BT-718-reduce-breadcrumb-size branch from 84f390a to 8d4594f Compare September 4, 2024 11:42
@perf2711 perf2711 force-pushed the feature/BT-718-reduce-breadcrumb-size--node branch from 1b84aaa to 0059123 Compare September 4, 2024 12:08
@perf2711 perf2711 changed the title BT-718 - Reduce breadcrumb size - Node node: reduce breadcrumb size Sep 11, 2024

return function lengthChunkSplitter(data) {
const remainingLength = maxLength - seen;
if (data.length <= remainingLength) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

its weird that later we respect wholeLines information but when the data.length <= remainingLenght we don't. Actually why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because if all data fits into remainingLength, we don't need to split it. Ergo, line splitting does not occur.

/**
* Splits data into chunks with maximum length.
* @param maxLength Maximum length of one chunk.
* @param wholeLines If `true`, will split chunks before newlines, so whole lines are passed to the chunk.
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we add a description for skip and break?

Comment on lines 121 to 122
return id;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

In the past id meant the id of the added breadcrumb. The breadcrumb id is no in the breadcrumb file. Should we return undefined instead? Or something that indicates that the breadcrumb was not added?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated so it returns undefined. sdk-core will also handle this.

@perf2711 perf2711 force-pushed the feature/BT-718-reduce-breadcrumb-size--node branch from 3acd0ca to 800f54f Compare September 25, 2024 07:35
Base automatically changed from feature/BT-718-reduce-breadcrumb-size to main September 26, 2024 14:58
@perf2711 perf2711 force-pushed the feature/BT-718-reduce-breadcrumb-size--node branch from 800f54f to 7d75b24 Compare September 26, 2024 15:35
@perf2711 perf2711 force-pushed the feature/BT-718-reduce-breadcrumb-size--node branch from 7d75b24 to 4f54ec2 Compare September 26, 2024 15:37
@perf2711 perf2711 merged commit 2e5743b into main Sep 26, 2024
5 checks passed
@perf2711 perf2711 deleted the feature/BT-718-reduce-breadcrumb-size--node branch September 26, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants