-
Notifications
You must be signed in to change notification settings - Fork 50
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
Duplicate Upload with events not being cleared from local data store #170
Comments
Code block provided:
func uploadToDataKeen() {
let application = UIApplication.sharedApplication()
let backgroundTaskID = application.beginBackgroundTaskWithExpirationHandler { () -> Voidin
print("Upload task for keen is expiring")
}
self.keenClient.uploadWithFinishedBlock { () -> Voidin
application.endBackgroundTask(backgroundTaskID)
}
} And the function is called via Observer callback: @objcprivatefunc didEnterBackground() {
trackPotentialOldSavedSession()
saveCurrentSession()
uploadToDataKeen()
} The observer is registered as follows: NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(TrackingService.didEnterBackground), name: UIApplicationDidEnterBackgroundNotification, object: nil) |
@subbuthepeaceful thanks for sending the code snippets, I'm sorry this is happening. :( Looking at the code, nothing comes to mind on why this may be happening... I'm going to take a closer look at this later today and update you here. |
Thank you very much @heitortsergent Please let me know if we can provide any additional information that would help diagnose |
@subbuthepeaceful I still don't see anything in the code snippets that could be causing the error... Could you please ask the customer the code block where they're calling the last line: NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(TrackingService.didEnterBackground), name: UIApplicationDidEnterBackgroundNotification, object: nil) |
Hi, @heitortsergent. We add this observer in the |
Hi all, Has there been any progress on this? I've been running into the same issues. |
Hi, is there any news on this issue? |
Details of Customer Keen IO Integration:
We are using Keen Library v3.5.5. We are not overriding keen.timestamp and are calling self.keenClient.uploadWithFinishedBlock when our app enters background mode.
Customer reports seeing duplicates around 25-35%. We can confirm that events with the exact same payload are being 'generated' twice i.e. with different values for keen.created_at.
This may be similar to Issue #156, but unsure whether uploadWithFinishedBlock is being called successively.
Opening the issue here so that we can collect more information in terms of trying to replicate the problem.
The text was updated successfully, but these errors were encountered: