Skip to content

docs: Update comments #2562

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
May 11, 2020
Merged

Conversation

rhcarvalho
Copy link
Contributor

Flushing out some edits I had locally for some days.

@rhcarvalho rhcarvalho requested a review from kamilogorek as a code owner April 28, 2020 20:54
@@ -175,9 +175,9 @@ export class Tracing implements Integration {
logger.warn(`[Tracing] We added a reasonable default for you: ${defaultTracingOrigins}`);
}

// Starting our inital pageload transaction
// Starting pageload transaction
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Instead of fixing the typo I decided for a shorter comment. I'd be even happier to remove it completely in favor of easier to read code.

Tracing.startIdleTransaction is not bad, but makes me wonder why is it called "idle" instead of "pageload".

Copy link
Member

Choose a reason for hiding this comment

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

Because in theory it can be used for other things besides just page load, and "idle" because it closes on idle timeout. I agree, though, that in the API review we're about to do, I'd like to reconsider the startIdleTransaction method name.

if (global.location && global.location.href) {
// `${global.location.href}` will be used a temp transaction name
// Use `${global.location.href}` as transaction name
Copy link
Contributor Author

Choose a reason for hiding this comment

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

What was once a "temporary name" seems to have settled as "the name" for now.

Also not sure how useful this comment is, if the code is not clear, we could refactor to introduce a descriptive constant:

const name = global.location.href;
Tracing.startPageloadTransaction(name, ...);

@rhcarvalho
Copy link
Contributor Author

Maybe this will not be just "update comments", but "refactor code" instead. Let's see.

@rhcarvalho
Copy link
Contributor Author

Going to merge this since it is just small changes to internal comments.

@rhcarvalho rhcarvalho merged commit f5a401a into getsentry:master May 11, 2020
@rhcarvalho rhcarvalho deleted the misc-comments branch May 11, 2020 12:00
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.

2 participants