Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.

feat: Add breadcrumbs when visibility changes#94

Merged
billyvg merged 13 commits intomainfrom
feat/visibility-changes
Jun 30, 2022
Merged

feat: Add breadcrumbs when visibility changes#94
billyvg merged 13 commits intomainfrom
feat/visibility-changes

Conversation

@billyvg
Copy link
Copy Markdown
Member

@billyvg billyvg commented Jun 24, 2022

This also changes the timeout of a session when page is hidden from
15 seconds to the session timeout of 15 minutes. This will reduce the
number of short-lived sessions when users tab around, as well as make
the timeout more consistent.

image

billyvg added 3 commits June 24, 2022 17:54
This also changes the timeout of a session when page is hidden from
15 seconds to the session timeout of 15 minutes. This will reduce the
number of short-lived sessions when users tab around, as well as make
the timeout more consistent.
},
"volta": {
"node": "14.19.0",
"node": "16.15.1",
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Need this for m1

@billyvg billyvg requested a review from a team June 24, 2022 22:22
src/index.ts Outdated
// Not all blurs will result in `document.visibilityState` being hidden.
// e.g. opening a new window, but new window does not completely overlap
// previous window
message: `Page is ${document.visibilityState}`,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this should be:

Suggested change
message: `Page is ${document.visibilityState}`,
message: `Page is blurred`,

The way it is right now we could have a breadcrumb list like this, where the first two events would be really confusing to read:

[
  [ ui.blur, "Page is visible" ],
  ...
  [ ui.focus, "Page is visible" ],
  ...
  [ ui.change_visibility, "Page is hidden" ],
  ...
  [ ui.blur, "Page is hidden" ],
  [ ui.change_visibility, "Page is visible" ],
   ...
  [ ui.focus, "Page is hidden" ],
]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I agree it's a bit noisy and confusing, but the data itself can be interesting (seeing that a user switches away from the window but with content still in view?) -- it's likely this will be more confusing than helpful, in which case we should just kill the message completely.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

talked offline, killing the message seems easiest because we still have the breadcrumb category which turns into a title. It's not ambiguous.

Also, I guess, translations are easier if we don't rely on the sdk to make user friendly text.

src/index.ts Outdated
// Not all blurs will result in `document.visibilityState` being hidden.
// e.g. opening a new window, but new window does not completely overlap
// previous window
message: `Page is ${document.visibilityState}`,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

talked offline, killing the message seems easiest because we still have the breadcrumb category which turns into a title. It's not ambiguous.

Also, I guess, translations are easier if we don't rely on the sdk to make user friendly text.

import { SentryReplay } from '@';
import {
SESSION_IDLE_DURATION,
VISIBILITY_CHANGE_TIMEOUT,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

keep this import because the fix is split out into #98 ?

record.takeFullSnapshot(true);
}

updateLastActivity(lastActivity: number = new Date().getTime()) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

couldn't set that default in python!

@billyvg billyvg requested a review from ryan953 June 29, 2022 14:32
@billyvg billyvg merged commit b63855a into main Jun 30, 2022
@billyvg billyvg deleted the feat/visibility-changes branch June 30, 2022 14:46
billyvg added a commit that referenced this pull request Jun 30, 2022
We handled the blur case but not the focus case in #94
mydea pushed a commit to getsentry/sentry-javascript that referenced this pull request Nov 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants