mixpanel / mixpanel-flutter

Official Flutter Tracking Library for Mixpanel Analytics
https://mixpanel.com
Apache License 2.0
68 stars 75 forks source link

[iOS][.getPeople().increment(prop,by)] is causing duplicated events to Mixpanel #93

Open arctouch-renancoelho opened 2 years ago

arctouch-renancoelho commented 2 years ago

The increment method is causing duplicated events, sometimes the increment adds two lines to the table causing duplicated values on Mixpanel, this issue can't be reproduced all the time, and it is complicated to understand the reason for this issue, but I've confirmed that the increment was called once but this sends the event twice to the Mixpanel, and after the first time this continue happening until disposing of the Mixpanel. I'm sending the log below. This only happens on iOS.

[Mixpanel - MPDB.swift - func insertRow(_:data:flag:)] (info) - Successfully inserted row into table mixpanel_aa22261a7a330f49ba71528c2d6efb85_events
[Mixpanel - MPDB.swift - func insertRow(_:data:flag:)] (info) - Successfully inserted row into table mixpanel_aa22261a7a330f49ba71528c2d6efb85_people
[Mixpanel - MPDB.swift - func insertRow(_:data:flag:)] (info) - Successfully inserted row into table mixpanel_aa22261a7a330f49ba71528c2d6efb85_people
[Mixpanel - MPDB.swift - func readRows(_:numRows:flag:)] (info) - Successfully read 1 from table mixpanel_aa22261a7a330f49ba71528c2d6efb85_events
[Mixpanel - MPDB.swift - func readRows(_:numRows:flag:)] (info) - Successfully read 2 from table mixpanel_aa22261a7a330f49ba71528c2d6efb85_people
[Mixpanel - Flush.swift - func flushQueueInBatches(_:type:)] (debug) - Sending batch of data
[Mixpanel - Flush.swift - func flushQueueInBatches(_:type:)] (debug) - [["event": $ae_session, "id": 4343, "properties": {
    "$ae_session_length" = "1704.6";
    "$app_build_number" = 1;
    "$app_version_string" = "2.0.0";
    "$carrier" = "";
    "$device_id" = "BF7CF7F2-4B19-420B-8429-04C4AD0B4A29";
    "$had_persisted_distinct_id" = 1;
    "$lib_version" = "1.6.0";
    "$manufacturer" = Apple;
    "$model" = "iPhone11,8";
    "$os" = iOS;
    "$os_version" = "14.4";
    "$radio" = None;
    "$screen_height" = 896;
    "$screen_width" = 414;
    "$user_id" = ce83592af987ae32ad16be57c866dcdbd2a4cc99e1f4c9a4e7db74abf73cfff0;
    "$wifi" = 1;
    "distinct_id" = ce83592af987ae32ad16be57c866dcdbd2a4cc99e1f4c9a4e7db74abf73cfff0;
    "mp_lib" = flutter;
    time = 1665523193507;
    token = aa22261a7a330f49ba71528c2d6efb85;
}, "$mp_metadata": {
    "$mp_event_id" = 3f3f84bb0baf09aa;
    "$mp_session_id" = 498479da57420e1c;
    "$mp_session_seq_id" = 296;
    "$mp_session_start_sec" = 0;
}]]
[Mixpanel - Network.swift - func buildURLRequest(_:resource:)] (debug) - Fetching URL
[Mixpanel - Network.swift - func buildURLRequest(_:resource:)] (debug) - https://api.mixpanel.com/track/?ip=1
[Mixpanel - MixpanelInstance.swift - func loggingEnabled] (info) - Logging Enabled
[Mixpanel - MPDB.swift - func insertRow(_:data:flag:)] (info) - Successfully inserted row into table mixpanel_aa22261a7a330f49ba71528c2d6efb85_people
[Mixpanel - Flush.swift - func flushQueueInBatches(_:type:)] (debug) - Sending batch of data
[Mixpanel - Flush.swift - func flushQueueInBatches(_:type:)] (debug) - [["$add": {
    "$ae_total_app_sessions" = 1;
}, "id": 3171, "$token": aa22261a7a330f49ba71528c2d6efb85, "$had_persisted_distinct_id": 1, "$mp_metadata": {
    "$mp_event_id" = 0f0736c0efce4a78;
    "$mp_session_id" = 498479da57420e1c;
    "$mp_session_seq_id" = 47;
    "$mp_session_start_sec" = 0;
}, "$device_id": BF7CF7F2-4B19-420B-8429-04C4AD0B4A29, "$distinct_id": "ce83592af987ae32ad16be57c866dcdbd2a4cc99e1f4c9a4e7db74abf73cfff0", "$time": 1665523193507, "$user_id": ce83592af987ae32ad16be57c866dcdbd2a4cc99e1f4c9a4e7db74abf73cfff0], ["$add": {
    "$ae_total_app_session_length" = "1704.6";
}, "id": 3172, "$token": aa22261a7a330f49ba71528c2d6efb85, "$had_persisted_distinct_id": 1, "$mp_metadata": {
    "$mp_event_id" = 660a8807bab07f66;
    "$mp_session_id" = 498479da57420e1c;
    "$mp_session_seq_id" = 48;
    "$mp_session_start_sec" = 0;
}, "$device_id": BF7CF7F2-4B19-420B-8429-04C4AD0B4A29, "$distinct_id": "ce83592af987ae32ad16be57c866dcdbd2a4cc99e1f4c9a4e7db74abf73cfff0", "$time": 1665523193507, "$user_id": ce83592af987ae32ad16be57c866dcdbd2a4cc99e1f4c9a4e7db74abf73cfff0]]
[Mixpanel - Network.swift - func buildURLRequest(_:resource:)] (debug) - Fetching URL
[Mixpanel - Network.swift - func buildURLRequest(_:resource:)] (debug) - https://api.mixpanel.com/engage/?ip=1
[Mixpanel - MPDB.swift - func deleteRows(_:ids:isDeleteAll:)] (info) - Succesfully deleted rows from table mixpanel_aa22261a7a330f49ba71528c2d6efb85_events
[Mixpanel - MPDB.swift - func deleteRows(_:ids:isDeleteAll:)] (info) - Succesfully deleted rows from table mixpanel_aa22261a7a330f49ba71528c2d6efb85_people
[Mixpanel - MPDB.swift - func readRows(_:numRows:flag:)] (info) - Successfully read 1 from table mixpanel_aa22261a7a330f49ba71528c2d6efb85_people
[Mixpanel - Flush.swift - func flushQueueInBatches(_:type:)] (debug) - Sending batch of data
[Mixpanel - Flush.swift - func flushQueueInBatches(_:type:)] (debug) - [["$had_persisted_distinct_id": 1, "$time": 1665523193649, "$set": {
    "$ios_app_release" = "2.0.0";
    "$ios_app_version" = 1;
    "$ios_device_model" = "iPhone11,8";
    "$ios_lib_version" = "3.3.0";
    "$ios_version" = "14.4";
    "$lib_version" = "1.6.0";
    "$swift_lib_version" = "3.3.0";
    "Last app open" = "2022-10-11T18:19:53.507667";
    "mp_lib" = flutter;
}, "$device_id": BF7CF7F2-4B19-420B-8429-04C4AD0B4A29, "$user_id": ce83592af987ae32ad16be57c866dcdbd2a4cc99e1f4c9a4e7db74abf73cfff0, "$mp_metadata": {
    "$mp_event_id" = a3fe39a363616b7d;
    "$mp_session_id" = 498479da57420e1c;
    "$mp_session_seq_id" = 49;
    "$mp_session_start_sec" = 0;
}, "id": 3173, "$distinct_id": "ce83592af987ae32ad16be57c866dcdbd2a4cc99e1f4c9a4e7db74abf73cfff0", "$token": aa22261a7a330f49ba71528c2d6efb85]]
[Mixpanel - Network.swift - func buildURLRequest(_:resource:)] (debug) - Fetching URL
[Mixpanel - Network.swift - func buildURLRequest(_:resource:)] (debug) - https://api.mixpanel.com/engage/?ip=1
[Mixpanel - MPDB.swift - func deleteRows(_:ids:isDeleteAll:)] (info) - Succesfully deleted rows from table mixpanel_aa22261a7a330f49ba71528c2d6efb85_people
Lost connection to device.
Exited
edlose16b commented 1 year ago

same with .append()