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

Avoid dropping sessions #976

Merged
merged 1 commit into from
Jun 20, 2024
Merged

Conversation

fractalwrench
Copy link
Contributor

Goal

Resolves an issue with the integration branch where sessions weren't persisted to disk as the session ID couldn't be found in the payload. The fix is to look first in the spans field, and then in the span_snapshots field for the session span.

I've also improved the error messaging around failed HTTP requests as it was initially very hard to tell that a 400 status code was received by the server. Finally, I've tweaked the type value to spans as this seems to be what the mock api expects, although the field is unused by the actual implementation at this time.

@fractalwrench fractalwrench requested a review from a team as a code owner June 19, 2024 16:14
@@ -41,6 +41,7 @@ internal data class Envelope<T>(

internal fun Envelope<SessionPayload>.getSessionSpan(): Span? {
return data.spans?.singleOrNull { it.hasFixedAttribute(EmbType.Ux.Session) }
?: data.spanSnapshots?.singleOrNull { it.hasFixedAttribute(EmbType.Ux.Session) }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh yeah this would be a thing

Copy link
Collaborator

@bidetofevil bidetofevil left a comment

Choose a reason for hiding this comment

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

LGTM

@fractalwrench fractalwrench changed the base branch from integration/v2-migration to add-internal-span-limit June 20, 2024 07:17
Base automatically changed from add-internal-span-limit to integration/v2-migration June 20, 2024 07:35
@fractalwrench fractalwrench merged commit 5a6d9ee into integration/v2-migration Jun 20, 2024
1 check passed
@fractalwrench fractalwrench deleted the fix-session-sending branch June 20, 2024 07:39
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.

None yet

2 participants