Skip to content

RUM-8672 Update UserInfo API to make id mandatory.#2195

Merged
dd-mergequeue[bot] merged 3 commits into
developfrom
maciey/RUM-8672/mandatory-user-id
Feb 28, 2025
Merged

RUM-8672 Update UserInfo API to make id mandatory.#2195
dd-mergequeue[bot] merged 3 commits into
developfrom
maciey/RUM-8672/mandatory-user-id

Conversation

@maciejburda

@maciejburda maciejburda commented Feb 20, 2025

Copy link
Copy Markdown
Member

What and why?

Makes id parameter of setUserInfo() mandatory. Old signature is kept with deprecation warning.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference
  • Add CHANGELOG entry for user facing changes
  • Add Objective-C interface for public APIs (see our guidelines [internal]) and run make api-surface)

@maciejburda
maciejburda requested review from a team as code owners February 20, 2025 11:01
@maciejburda
maciejburda marked this pull request as draft February 20, 2025 11:01
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Feb 20, 2025

Copy link
Copy Markdown

Datadog Report

Branch report: maciey/RUM-8672/mandatory-user-id
Commit report: 60b18f9
Test service: dd-sdk-ios

✅ 0 Failed, 357 Passed, 3459 Skipped, 37.7s Total duration (1m 57.82s time saved)

@maciejburda
maciejburda marked this pull request as ready for review February 20, 2025 11:33
Comment thread DatadogCore/Sources/Datadog.swift

@barboraplasovska barboraplasovska left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM👌

Comment thread DatadogCore/Sources/Datadog.swift
@maciejburda

Copy link
Copy Markdown
Member Author

/merge

@dd-devflow

dd-devflow Bot commented Feb 28, 2025

Copy link
Copy Markdown

View all feedbacks in Devflow UI.
2025-02-28 12:22:48 UTC ℹ️ Start processing command /merge


2025-02-28 12:22:51 UTC ℹ️ MergeQueue: waiting for PR to be ready

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2025-02-28 14:13:13 UTC ℹ️ MergeQueue: merge request added to the queue

The median merge time in develop is 27m.


2025-02-28 14:53:46 UTC ℹ️ MergeQueue: This merge request was merged

@shagedorn

Copy link
Copy Markdown

What's the motivation behind this change?

We currently set id to nil when a user logs out of the app, in which case we don't have a useful id anymore. We would now have to come up with an arbitrary string value to signal this, and it will look different than the initial (pre-login) state where no user id was set at all. It complicates something that was never a problem for us.

@maciejburda

maciejburda commented Mar 17, 2025

Copy link
Copy Markdown
Member Author

Thanks for tuning in, @shagedorn!

The motivation behind this change is purely internal, aimed at aligning our platforms with the introduction of our new product, Product Analytics.

Your logout scenario makes perfect sense, and it raises a valid point - perhaps we need an additional API to clear the entire user object. For now, you can continue using the deprecated function, or start a new session after user logs out (which will clear the user info).

We’d really appreciate it if you could reach out through official support and share your exact use cases. This will help us explore whether there’s a better way to address this change while minimising any disruption on your end.

@shagedorn

Copy link
Copy Markdown

Thanks for your response! I described our use case in ticket nr. 2081021.

@maciejburda

Copy link
Copy Markdown
Member Author

Thanks! I'll look into it.

Also, correction - stopping the session won't clear the user automatically. We will likely add an API to clear the user.

@siddarthkalra

Copy link
Copy Markdown

@maciejburda we're facing a very similar issue after updating to the latest SDK release. What's the current guidance with handling the logged out state for an app when no user ID is available?

@maciejburda

Copy link
Copy Markdown
Member Author

Hey @siddarthkalra and @shagedorn

We'll be adding clearUserInfo() API in the upcoming release. Unfortunately id must stay non-optional for business reasons.

Is it something that will help handling your case?

@shagedorn

Copy link
Copy Markdown

@maciejburda thanks for following up!

I believe this would help us indeed. We have some properties we set via the extraInfo: parameter, which we'd like to retain post logout, but I think we could use addUserExtraInfo(…) to re-apply them after calling clearUserInfo().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants