appwrite icon indicating copy to clipboard operation
appwrite copied to clipboard

🐛 Bug Report: Expired targets not automatically deleted

Open ayushpathak-48 opened this issue 1 year ago • 2 comments

👟 Reproduction steps

Go to console

Create FCM provider for push messaging

Create a token of a device and save it into appwrite

Then re create the token and again save it to appwrite

Then send notification to the web target

Then you will get an error for the expired device token

Again after 1 day th same error occurs.

But appwrite says it should be removed after a days if it's expired

👍 Expected behavior

It should be removed

👎 Actual Behavior

It's giving same errror everyday

🎲 Appwrite version

Appwrite Cloud

💻 Operating system

Windows

🧱 Your Environment

I am using node-appwrite to create push target and for creating push notification

👀 Have you spent some time to check if this issue has been raised before?

  • [X] I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

ayushpathak-48 avatar May 19 '24 04:05 ayushpathak-48

Related thread: https://discord.com/channels/564160730845151244/1241034854922063954

stnguyen90 avatar May 20 '24 17:05 stnguyen90

@ayushpathak-48, thanks for raising this issue! 🙏🏼 We do mark expired targets as such:

https://github.com/appwrite/appwrite/blob/fd7228984bde7e9e0f5af4a98fa003777ac63634/src/Appwrite/Platform/Workers/Messaging.php#L272-L284

but it seems like the maintenance task that deletes expired targets isn't triggered per project:

https://github.com/appwrite/appwrite/blob/3d8bdef9a0713adb7968e6d34067231c08f024e8/src/Appwrite/Platform/Tasks/Maintenance.php#L44-L64

so the delete worker doesn't delete the expired targets per project:

https://github.com/appwrite/appwrite/blob/fd7228984bde7e9e0f5af4a98fa003777ac63634/src/Appwrite/Platform/Workers/Deletes.php#L292-L304

stnguyen90 avatar May 20 '24 17:05 stnguyen90

@stnguyen90 is this issue open for assignment?

ItzNotABug avatar Jun 04 '24 08:06 ItzNotABug

@ItzNotABug, sure, ya. Assigned!

stnguyen90 avatar Jun 05 '24 23:06 stnguyen90