Open p1gp1g opened 9 months ago
@LucasGGamerM / @FineFindus this may interest you
BTW, from time to time (like, when you open the app, if the code bellow has not been called in the last 6h), it would be a good thing to do:
if (!UnifiedPush.getDistributor(context).isEmpty()) {
UnifiedPush.registerApp(
context,
session.getID(),
getDEFAULT_FEATURES(),
context.getPackageName()
);
}
There was an issue on mastodon preventing doing this, but this has been fixed since https://github.com/mastodon/mastodon/pull/27858
The joys of writing Java code... Thanks for catching that.
BTW, from time to time (like when you open the app, if the code below has not been called in the last 6h), it would be a good thing to do:
I'm not quite sure why this is necessary. Could you please clarify?
BTW, from time to time (like when you open the app, if the code below has not been called in the last 6h), it would be a good thing to do:
I'm not quite sure why this is necessary. Could you please clarify?
If somehow the server wipes the push endpoint, it will register it again.
For context, subscribing from time to time was not something we recommended for mastodon before the correction (27858 cited earlier), because mastodon didn't override previous subscriptions but appended it and it ended spamming push providers and adding load to the mastodon queue. When the patch has been released is a good example why registering from time to time is useful: some subscriptions (and push endpoints) were wiped with the upgrade. Registering again can be done when the app starts but I think adding a delay (x hours) is a good thing to avoid spamming the server.
@FineFindus should I open a PR on moshidon too ?
I had already mentioned this pr (alongside the other still open ones here) to @LucasGGamerM, but he probably just forgot about it, since there was and still is a lot of work going on with trying to merge all the new code by the official app. If you have the time, a PR would certainly be appreciated :)
Yes. I completely forgot about this specific one. Silly me :D
I am merging it
Yes. I completely forgot about this specific one. Silly me :D
I am merging it
I just merged this one and the one of the other notification related crashes PRs I found in Megalodon's repo. It's all on Moshidon now too :D
I often experience a NullPointer Exception on double push:
This fixes this issue.