pachli / pachli-android

The Pachli Android app
https://pachli.app
GNU General Public License v3.0
132 stars 15 forks source link

Pachli doesn't stop creating UP topics #934

Closed nichu42 closed 1 month ago

nichu42 commented 2 months ago

Describe the bug After reworking the notification system, Pachli creates new UnifiedPush topics in ntfy every other day. See screenshot. It happens only on my tablet, my phone works fine.

Expected behavior Only one UP topic per account in Pachli.

Screenshots or video Screenshot_20240909_175837_ntfy_1.jpg

Versions Pachli 2.8.1 ntfy 1.16.0 (fdroid) samsung SM-P613 Android-Version: 14 SDK-Level: 34

Affirmation I have checked other issues for this project (open and closed) and I cannot find one that matches the problem I am reporting.

JakubIwanowski commented 2 months ago

Same thing happens, if you're logged in with multiple accounta, and you switch between them. Each switch of an account = one UP topic created

Pachli 2.8.0 from fdroid OnePlus IN2013 Android version: 14 SDK level: 34

nichu42 commented 2 months ago

Ah, yes! That's when it happens. The same on my other device (Fairphone 5).

nikclayton commented 2 months ago

Thanks for the report, sorry about that.

Note to self: Check the code that works around the store bugs in UnifiedPush isn't wiping out the per-UnifiedPush-instance token in UnifiedPush.registerApp

nikclayton commented 1 month ago

@JakubIwanowski @nichu42 Do you still see this behaviour?

When I checked two weeks ago I could reproduce just by switching accounts, as you report.

Now I can't. I'm logged in with two accounts, and see two topics in ntfy.

When I switch accounts (or swipe/dismiss Pachli and re-open it), then check ntfy, I still see two topics in ntfy.

The endpoint (the ntfy.sh/... bit) shown in ntfy changes every time, but that's expected, as Pachli resubscribes on launch and when accounts are switched, in case there was a problem subscribing to notifications on the last attempt.

I see the same behaviour if I install https://unifiedpush.org/users/distributors/fcm/ and switch to that (in Pachli this is "Preferences > Change Unified Push distributor"). Pachli registers once per account, so for me it shows up twice.

Or is this behaviour you only see once per day?

nichu42 commented 1 month ago

@nikclayton I just checked. On my smartphone, I'm connected with three Mastodon accounts. I had > 20 UP entries for Pachli. I have now deleted them all, opened up Pachli again and switched back and forth between the accounts. I now have 5 entries, but that's it for now.

Edit: On my tablet I had 43 entries (5 accounts), now 6 entries.

I will try again tomorrow.

JakubIwanowski commented 1 month ago

@nikclayton

I've reinstalled Pachli. When I added two Mastodon accounts, everything seemed to be working fine, but when I added a GoToSocial account, the app started adding topics every time I switch an account. Maybe it has to something to do with GTS account?

JakubIwanowski commented 1 month ago

One more thing, GTS doesn't have push notifications implemented, yet:

https://github.com/superseriousbusiness/gotosocial/issues/2797 https://github.com/superseriousbusiness/gotosocial/issues/1350

Maybe that's what's registering extra topics?

nichu42 commented 1 month ago

@nikclayton

Maybe it has to something to do with GTS account?

It's only Mastodon here, so I doubt it is (only) GTS related.

nikclayton commented 1 month ago

Thanks for the additional details. I'm rolling out a new version of Pachli Current which might resolve this. It's difficult to tell, since I still can't reproduce the problem, and I have five accounts logged in.

This is currently stuck in Google Play because of a bug there (I've escalated that separately).

If you'd like to check sooner, and you're comfortable installing a downloaded APK file, the most recent release build for Google Play is at https://github.com/pachli/pachli-android/actions/runs/11036688928 (the "app-release.apk" link at the bottom of the page). If you can try that and let me know if it resolves the issue for you that would be great.

JakubIwanowski commented 1 month ago

@nikclayton

Looks like it working, now! Thanks! :)

nikclayton commented 1 month ago

@JakubIwanowski Thanks for the feedback. @nichu42 Pachli Current has been updated with this change, if you're able to try that.

nichu42 commented 1 month ago

@nikclayton I do not have Pachli Current installed. Does ist always have the latest version or is it sometimes behind the release?

nichu42 commented 1 month ago

I have switched to Pachli Current 2.8.2+f9ca3cd7 and can confirm that the issue is gone. Thank you!