Back

Targets disappeared

  • 0
  • Flutter
  • Messaging
  • Auth
  • Cloud
RikasLu
20 Oct, 2024, 08:30

Hi, I don't know exactly when, but I see that the push targets of almost all users have disappeared, is this normal? Prj. ID. 6665de8b001d6c9b0a25

TL;DR
Developers reported an issue with disappearing push targets, even though a fix has been deployed. An investigation revealed that some targets were being marked as expired incorrectly. The fix is available in a pull request on GitHub. Tokens are supposed to be marked as expired only if Firebase returns a specific error. There were concerns regarding automation deleting targets and confusion about how targets are considered expired. It was noted that FCM tokens don't expire unless the app is uninstalled. Scheduled updates every 5 days may play a role in targets disappearing. The issue remains unresolved.
Steven
20 Oct, 2024, 19:54

Ya all the same

Steven
20 Oct, 2024, 19:55

How many? Could it be that some targets were expired, but not the one specified?

RikasLu
20 Oct, 2024, 20:16

sometimes 1, sometimes 2

RikasLu
20 Oct, 2024, 20:17

I once tried to send a push manually to an expired token and it sent it correctly, again via appwrite

RikasLu
20 Oct, 2024, 20:23

yes but even if it was considered expired it didn't delete them, today I found many deleted items, is there any scheduled event that cleans?

Steven
20 Oct, 2024, 21:00

Send to only 1 target and you got an error saying it was expired?

Steven
20 Oct, 2024, 21:01

Yes, they are deleted as a background job. No guarantee as to when exactly it'll run

RikasLu
20 Oct, 2024, 22:02

ah...but why they are expired...

RikasLu
20 Oct, 2024, 22:02

i need to investigate..

RikasLu
20 Oct, 2024, 22:03

no it is sent without errors, I will try again as soon as I have time

Steven
20 Oct, 2024, 22:07

The only thing I can think of is it is marked as expired in Appwrite, then you update it, but it's still marked as expired, and then it gets deleted

RikasLu
20 Oct, 2024, 22:44

Is it marked as expired only when Google is engaged in an attempt to send a push?

Steven
20 Oct, 2024, 22:46

What do you mean? The API call is made to Google/firebase and then we mark it as expired depending on the response

RikasLu
21 Oct, 2024, 14:53

On appwrite, is the status of "EXPIRED" inserted when the first push is sent?

Steven
21 Oct, 2024, 14:53

It's supposed to be marked as expired only if firebase returns the not found or unregistered error

Steven
21 Oct, 2024, 14:54

But I think we may be correlating it wrong so the wrong target in the batch is marked as expired

Steven
21 Oct, 2024, 14:55
RikasLu
21 Oct, 2024, 15:00

so there is actually an index problem, and a token that has not actually expired is then updated in the table

RikasLu
22 Oct, 2024, 13:54

@Steven Hi Steven, I saw that the fix to this problem was merged into master, just out of curiosity, how will this be released on the cloud now?

Steven
22 Oct, 2024, 16:37

we need to deploy it

Steven
22 Oct, 2024, 21:06

We've deployed the fix.

  1. the push target should specify whether it's expired or not now
  2. updating a push target will reset the expired flag
  3. the correct recipient should be marked as expired if the push fails

Let me know how it goes.

RikasLu
23 Oct, 2024, 07:42

good, for 1. where i can see if the push target is marked expired or not?

Steven
23 Oct, 2024, 13:34

In the payload. For example, account.get() includes the targets.

RikasLu
23 Oct, 2024, 15:09

Perfect, I think I can see it with command cli, top, thank you

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more