Skip to content
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

Change view logic to emit LifeCycle events #366

Merged
merged 14 commits into from
Apr 21, 2020

Conversation

BenoitZugmeyer
Copy link
Member

Motivation: use lifecycle events to create new user actions.

@BenoitZugmeyer BenoitZugmeyer requested a review from a team as a code owner April 17, 2020 14:56
This commit takes a different approach on fixing the session id used
when sending RUM events right before the session is renewed.

Originally, it was fixed in commit
7bc0dfb by storing the session id into
the current view.  Since the view was recreated when the session was
renewed, events sent during a view were guaranteed to have the same
session id than the view.

The problem with this approach was that the sessionId was unexpectedly
stored in the view context, making different parts of the code
dependendent to the view logic.

This new solution goal is to be more explicit, and simplify the view
logic. The current session id (and type) is kept into the rumSession
module, to ensure a consistency accross the RUM library. A new lifeCycle
event is sent when the view is about to be renewed, but the session id
is still the same.
The view logic will be changed to emit lifeCycle events. Like other
component emiting lifeCycle events, name the file as "xxCollection"
This change is a first step to decouple the view logic from the Batch
implementation.
packages/rum/src/rumSession.ts Outdated Show resolved Hide resolved
packages/core/src/transport.ts Show resolved Hide resolved
@BenoitZugmeyer
Copy link
Member Author

OK I reverted all session changes, and went back to the viewContext.sessionId for now. Things may be changed in a future PR.

packages/rum/src/lifeCycle.ts Outdated Show resolved Hide resolved
packages/rum/src/viewCollection.ts Outdated Show resolved Hide resolved
packages/rum/src/viewCollection.ts Show resolved Hide resolved
@BenoitZugmeyer BenoitZugmeyer merged commit 692e9c5 into master Apr 21, 2020
@BenoitZugmeyer BenoitZugmeyer deleted the benoit/view-collected-event branch April 21, 2020 12:00
BenoitZugmeyer added a commit that referenced this pull request Apr 22, 2020
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.

4 participants