stacker.news icon indicating copy to clipboard operation
stacker.news copied to clipboard

Push notification "~undefined was transferred to you"

Open felipebueno opened this issue 1 year ago • 8 comments

I received the push notification "~undefined was transferred to you" a few hours ago but I don't know what it is and it's not listed at my /notifications page.

felipebueno avatar Mar 11 '24 12:03 felipebueno

Mhh, this is going to be interesting to find out. We are only sending out push notifications for territory transfers (a recently added feature, see #878) here:

https://github.com/stackernews/stacker.news/blob/179a539d4d2218be30095a153cf5d1d04839de7a/api/resolvers/sub.js#L285-L318

So afaict currently, we should only send out a push notification if the query succeeded :thinking:

But no territory transfer from today was inserted into the database.

Can you let us know when it happens again?

ekzyis avatar Mar 11 '24 16:03 ekzyis

Can you let us know when it happens again?

For sure!

But no territory transfer from today was inserted into the database.

I think it happened around 3am BRT (UTC-3) but I'm not sure. I looked at my phone around 7am and (again) I think the notifications was saying "4 hours ago" or something. But I'm not sure because I was still sleepy and wasn't wearing my reading glasses, so I might be wrong.

Then I tapped the notification but it took me nowhere. I should've taken a screenshot before tapping it but I forgot. I was too sleepy

felipebueno avatar Mar 11 '24 16:03 felipebueno

Can you let us know when it happens again?[

@ekzyis it didn't happen again. Should I close this issue?

felipebueno avatar Mar 14 '24 12:03 felipebueno

Yes, you can

ekzyis avatar Mar 14 '24 13:03 ekzyis

@ekzyis @huumn it happened again

The time is BRT (UTC-3)

image

felipebueno avatar Mar 20 '24 21:03 felipebueno

Can confirm, I got the same push notifications

Really mysterious :eyes:

ekzyis avatar Mar 20 '24 21:03 ekzyis

I think this is a different issue than the one we just encountered. Sounds like it might be similar. Perhaps there are undefined values when territories are transferred.

huumn avatar Mar 20 '24 21:03 huumn

Yes, the ticket is about sub.name being undefined in noteTerritoryTransfer. Will test the code more. There are only two places where noteTerritoryTransfer is called but can't find anything obviously wrong like what just happened:

Here:

https://github.com/stackernews/stacker.news/blob/b35302ccdc61d86d24fd09d7739311f6a17b035d/api/resolvers/sub.js#L284-L317

and here:

https://github.com/stackernews/stacker.news/blob/b35302ccdc61d86d24fd09d7739311f6a17b035d/api/resolvers/sub.js#L318-L371

ekzyis avatar Mar 20 '24 22:03 ekzyis

I'm going to close this as we fixed the issue that reopened it and we can't reproduce or reason about the event that opened the ticket.

huumn avatar Mar 27 '24 16:03 huumn