Skip to content

Conversation

@franco-zalamena-iterable
Copy link

@franco-zalamena-iterable franco-zalamena-iterable commented Jan 21, 2026

🔹 Jira Ticket(s) if any

✏️ Description

Tests for fixing the double callbacks and related issues

void tryMergeUser(IterableApiClient apiClient, String unknownUserId, String destinationUser, boolean isEmail, boolean merge, MergeResultCallback callback) {
IterableLogger.v(TAG, "tryMergeUser");
if (unknownUserId != null && merge) {
if (unknownUserId != null && merge) { //todo: why can we try to merge and have merge false?
Copy link
Member

Choose a reason for hiding this comment

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

Can you elaborate the question here?

Choose a reason for hiding this comment

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

Yes, i feel like it can be more of a semantical question in the regard of the method beingCalled tryMergeUser and then we get a flag that can say not to merge

Copy link
Member

@Ayyanchira Ayyanchira left a comment

Choose a reason for hiding this comment

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

Added some comments @franco-zalamena-iterable

if (config.enableUnknownUserActivation && getVisitorUsageTracked()) {

if (emailOrUserId != null && !emailOrUserId.equals(_userIdUnknown)) {
if (emailOrUserId != null && !emailOrUserId.equals(_userIdUnknown)) { //todo: when would the userIdUnknown be the same?
Copy link
Member

Choose a reason for hiding this comment

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

This is a part of feature called unknownUser. Will have to audit the algorithm here to sit and verify if its as expected

@franco-zalamena-iterable
Copy link
Author

The new commit has a new way of handling the callbacks, this will be enough for the client that currently receives 2 callbacks since they can choose to only listen to the last one. Also, not sure if making the actual changes to make the callback null make sense now, since there are places that this can be used. I will be reverting the callback to null fix so we can keep the behaviour as is today and make a different PR for better handling the callback lifecycle

* remote and local success cases.
*/
public interface RemoteSuccessCallback extends IterableSuccessCallback {
void onSuccess(@NonNull IterableResponseObject.RemoteSuccess data);

Check notice

Code scanning / CodeQL

Confusing overloading of methods Note

Method RemoteSuccessCallback.onSuccess(..) could be confused with overloaded method
onSuccess
, since dispatch depends on static types.
* won't need to use this callback directly.
*/
public interface AuthTokenCallback extends IterableSuccessCallback {
void onSuccess(@NonNull IterableResponseObject.AuthTokenSuccess data);

Check notice

Code scanning / CodeQL

Confusing overloading of methods Note

Method AuthTokenCallback.onSuccess(..) could be confused with overloaded method
onSuccess
, since dispatch depends on static types.
* won't need to use this callback directly.
*/
public interface AuthTokenCallback extends IterableSuccessCallback {
void onSuccess(@NonNull IterableResponseObject.AuthTokenSuccess data);

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'data' is never used.
* local and remote success cases.
*/
public interface LocalSuccessCallback extends IterableSuccessCallback {
void onSuccess(@NonNull IterableResponseObject.LocalSuccess data);

Check notice

Code scanning / CodeQL

Confusing overloading of methods Note

Method LocalSuccessCallback.onSuccess(..) could be confused with overloaded method
onSuccess
, since dispatch depends on static types.
* @param successHandler The callback which returns `success`.
*/
public synchronized void setRead(@NonNull IterableInAppMessage message, boolean read, @Nullable IterableHelper.SuccessHandler successHandler, @Nullable IterableHelper.FailureHandler failureHandler) {
public synchronized void setRead(@NonNull IterableInAppMessage message, boolean read, @Nullable IterableHelper.IterableSuccessCallback successHandler, @Nullable IterableHelper.FailureHandler failureHandler) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'failureHandler' is never used.
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.

3 participants