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

Incorrectly marking devices as inactive #268

Open
irfankpr opened this issue May 23, 2024 · 6 comments
Open

Incorrectly marking devices as inactive #268

irfankpr opened this issue May 23, 2024 · 6 comments

Comments

@irfankpr
Copy link

A significant issue I have encountered with the Django-FCM library while implementing push notifications in my developing app.
I have configured Django-FCM with the setting DELETE_INACTIVE_DEVICES = True, expecting it to only remove devices that are genuinely inactive. However, I have observed that the library has deleted many devices from the FCMDevice model, despite these devices being active.
Some of the deleted devices were physically in my possession, running the app and connected to the network, but they did not receive notifications and were subsequently deleted from the model.This unexpected behavior has caused considerable disruptions in my push notification system, as active devices are being wrongly classified as inactive and subsequently removed from the FCMDevice model.

I would like to understand how FCM determines whether a device is active or inactive. This information would help me better diagnose and address the issue. Any insights or solutions to ensure that only truly inactive devices are deleted would be greatly appreciated. If necessary, I can provide further details about my Django and FCM configurations.

@xtrinch
Copy link
Owner

xtrinch commented May 23, 2024

It's like you desribed - devices not receiving notifications are marked as inactive. So if a notification cannot be sent to a device, it's marked as inactive. There's no network checks and if the user is using the app and so forth. May I ask why they are not receiving notifications?

@irfankpr
Copy link
Author

Some of the devices that were marked as inactive are being actively used for testing the application. These devices were online and had the application open in front of me when I attempted to push notifications. Despite this, these devices were marked as inactive after the notification push attempt.

Here are the specific observations:

  1. Active and Online Devices: The devices were connected to the network and actively running the application.
  2. Notification Push: I attempted to push notifications to all devices listed in the FCMDevice model.
  3. Mixed Results: Out of all devices, only one device successfully received the notification and was not marked as inactive. The rest, despite being active and online, did not receive the notification and were subsequently marked as inactive.

@xtrinch
Copy link
Owner

xtrinch commented May 24, 2024

I would suggest logging out the actual reason why FCM was unable to deliver the notification?

@irfankpr
Copy link
Author

irfankpr commented May 27, 2024

I would suggest logging out the actual reason why FCM was unable to deliver the notification?

as i mentioned in previous replay , The devices were connected to the network and actively running the application. means they were logged-in

@xtrinch
Copy link
Owner

xtrinch commented May 27, 2024

Understood. But that alone is not informational enough. You will require the actual response from FCM, to be able to infer any conclusions here.

@xtrinch
Copy link
Owner

xtrinch commented May 29, 2024

Also @irfankpr FCM will sometimes replace tokens for active devices in which case old ones will not work. In any way, you will need to diagnose why they got deactivated to proceed further

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

No branches or pull requests

2 participants