-
Notifications
You must be signed in to change notification settings - Fork 4k
Keep SessionInfo active after initialization, but include connection information #9886
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
Conversation
frontend/app/src/App.tsx
Outdated
| appId = this.sessionInfo.current.appId | ||
| sessionId = this.sessionInfo.current.sessionId | ||
| pythonVersion = this.sessionInfo.current.pythonVersion | ||
| } |
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.
We might need to inform the data team that there will be a risk of page profiles with missing appId/sessionId/pythonVersion since it might be something that breaks some piplines/apps. Or maybe it's easier to just not send the page profile if session info is not available since it might not be very useful anyway (I believe the appId is quite important for many metric apps).
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.
Also maybe it makes sense to show a warning via logWarning in case session state is not set yet
1e94c6e to
cd85d19
Compare
cd85d19 to
d3fb107
Compare
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
✅ PR preview is ready!
|
d3fb107 to
af7bbd6
Compare
frontend/app/src/App.tsx
Outdated
| @@ -1159,7 +1175,7 @@ export class App extends PureComponent<Props, State> { | |||
| /** | |||
| * Performs one-time initialization. This is called from `handleNewSession`. | |||
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.
nit: maybe also adapt the comment that this initialization can happen on the first connection or on a reconnection.
frontend/app/src/App.tsx
Outdated
|
|
||
| requestFileURLs = (requestId: string, files: File[]): void => { | ||
| if (this.isServerConnected()) { | ||
| if (this.isServerConnected() && this.sessionInfo.isSet) { |
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.
nit: maybe we log to console a warning that the server is not connected or the session info is not set.
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.
LGTM 👍 One nit: maybe you can move the three properties up to the Common Event Fields in the Metrics.proto:
| string app_id = 33; |
Describe your changes
We hit race conditions where the session info is cleared (on disconnect) and reconnected before a page profile message is sent. We've hit multiple issues with this, so the safest option is to not completely delete the sessionInfo. In the event of the page profile, the message is sent with the latest information it knows. We save the connection state in the session info and update it to be disconnected on disconnect. It will reset once a new NewSession message arrives.
GitHub Issue Link (if applicable)
closes #9767
Testing Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.