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

Breaking change in 6.10.0 kotlin access to Embrace.getInstance().deviceId #1253

Closed
jt-gilkeson opened this issue Aug 14, 2024 · 6 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@jt-gilkeson
Copy link

jt-gilkeson commented Aug 14, 2024

In 6.9.2 and prior in kotlin you could call:
Embrace.getInstance().deviceId

In 6.10.0 it says it can't find that declaration and wants you to call the old school getDeviceId() ?

Didn't see this in the release notes, was it intentional?

@bidetofevil bidetofevil self-assigned this Aug 15, 2024
@bidetofevil
Copy link
Collaborator

Hi @jt-gilkeson - thanks for the report! I'll take a look. We did some cleanup and hadn't noticed this changing on our end, likely because getDeviceId(() is the intended API which is still based in Java.

I'll have a look at other cases and update the release notes based on this.

@bidetofevil
Copy link
Collaborator

So it looks like the underlying implementation that backs the getDeviceId() method in the interface was a regular function rather an a property that has a getter implementation, while all the other properties exposed like currentSessionId was reimplemented as the latter. That left deviceId as the outlier.

How it is exposed via the Embrace object in Kotlin likely changed when we moved Kotlin versions to 1.8.x.

I'll add that to the release notes and remedy this in the code to make it consistent with all the other getter functions on the interface.

@bidetofevil
Copy link
Collaborator

BTW, lastRunState has the same issue. I will also note this

@bidetofevil bidetofevil added the bug Something isn't working label Aug 15, 2024
@bidetofevil
Copy link
Collaborator

Hi @jt-gilkeson - I've updated the release notes to reflect this. We may restore the previous behaviour in 6.11 to preserve the consistency of the API, but this and other synthetic properties will not be exposed as such in the next major version, at least not as an immutable property. The deviceId can change depending if the SDK is enabled, so we'll either make this mutable or leave it only accessible as a method.

@bidetofevil
Copy link
Collaborator

One more addendum - I can confirm that we will restore access through the synthetic property for both of these in our next release. We will reevaluate these going forward, but they will be semantically correct in the next major version

@bidetofevil
Copy link
Collaborator

FYI, this fix was released as part of 6.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants