-
Notifications
You must be signed in to change notification settings - Fork 57
refactor: added helper function performSessionEnd #1113
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
base: development
Are you sure you want to change the base?
Changes from all commits
c9c08e0
952f67a
8dfeb98
a42fbf9
1741978
6039a3b
1ad176d
3c4a644
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -33,31 +33,24 @@ export default function SessionManager( | |||||||||||||||
|
|
||||||||||||||||
| this.initialize = function (): void { | ||||||||||||||||
| if (mpInstance._Store.sessionId) { | ||||||||||||||||
| const sessionTimeoutInMilliseconds: number = | ||||||||||||||||
| mpInstance._Store.SDKConfig.sessionTimeout * 60000; | ||||||||||||||||
|
|
||||||||||||||||
| if ( | ||||||||||||||||
| new Date() > | ||||||||||||||||
| new Date( | ||||||||||||||||
| mpInstance._Store.dateLastEventSent.getTime() + | ||||||||||||||||
| sessionTimeoutInMilliseconds | ||||||||||||||||
| ) | ||||||||||||||||
| ) { | ||||||||||||||||
| const { dateLastEventSent, SDKConfig } = mpInstance._Store; | ||||||||||||||||
| const { sessionTimeout } = SDKConfig; | ||||||||||||||||
|
|
||||||||||||||||
|
||||||||||||||||
| // Note: hasSessionTimedOut() expires sessions AT the configured timeout | |
| // boundary (using a >= comparison), whereas older versions of initialize() | |
| // only expired sessions AFTER the timeout period using a > comparison. | |
| // This aligns initialize() with endSession() but is a behavioral change that | |
| // can affect applications that relied on the previous "grace" past timeout. |
jaissica12 marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed we're not including this line in the performSessionEnd function. Can it be used there? If not, can it be safely removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jaissica12 Did you address this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like she added it to nullify session which happens inside of performSessionEnd
Uh oh!
There was an error while loading. Please reload this page.