-
Notifications
You must be signed in to change notification settings - Fork 63
Limit writes to session file #243
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
eliasyishak
merged 9 commits into
dart-lang:main
from
eliasyishak:limit-read-writes-to-session-json
Mar 6, 2024
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7b83ba7
Refactor to use modified dt for _lastPing
eliasyishak 09e1680
Fix tests + misc dartdoc fixes
eliasyishak 09caa2a
Bump version
eliasyishak 3f7ee72
Create `sessionFile` in constructor
eliasyishak 00568cb
Simplify `lastPingDateTime`
eliasyishak 66a9198
Revert filename + pass session id to initializer
eliasyishak 60bc722
Use nullable field for `_sessionId`
eliasyishak ff2578a
Format fix
eliasyishak aac63d2
Change to wip + use `else` block for timestamp
eliasyishak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Create
sessionFile
in constructor
- Loading branch information
commit 3f7ee72d76a97e22ee6ce0656b13d5d1ac2b75ec
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
this seems like it's "solving" the problem of LateInitializationError by assigning the variable the wrong value. Or am I misunderstanding how this works?
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.
You're correct, this value is getting set when calling the constructor and it will eventually get replaced when we run
Session.initialize
. This just makes it so that we don't have to make the variablelate
.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.
It's technically not an invalid session id since later on in the code, we could be setting the this value in the file because we need a new session id if the old one had 30 mins of inactivity
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.
But if it has NOT been 30 minutes of inactivity, the correct session ID would be a different value, right?
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.
Yes that's correct, we would have to decide if that is worth it to remove the
late
variableThere 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.
lemme take a look at this later today?
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.
sgtm, no rush
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.
from discussion, maybe we should just make _sessionId nullable, and allow sending a null session id. this would also help when sending errors.
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.
Yep this makes sense with me, i also just confirmed that sending
null
for the session id is a valid json payload for GA4