ReVanced / revanced-patches

🧩 Patches for ReVanced
https://revanced.app
GNU General Public License v3.0
2.42k stars 280 forks source link

bug: Sync for reddit returns an HTTP 400 when loading some pages [w/ bounty] #3255

Closed kieraneglin closed 5 months ago

kieraneglin commented 5 months ago

Bug description

There appears to have been a recent change to Reddit's API that stops clients from accessing certain endpoints. For me, I can't load any subreddits or the comments on any posts, but I can load posts from a multireddit I've created. I have a hunch this will change over time.

Related to #3254

Error logs

No response

Solution

I haven't confirmed this, but some are saying that Reddit is denying requests to the API if the user agent contains android. This commit may also be helpful.

I'm not going to backseat dev, but maybe the solution would be a patch that updates the user agent to a new default but also allows the user to specify a custom agent if desired. Just a thought!

Additional context

Similar to this issue, I'm offering a $50 USD bounty via PayPal for whoever can create a patch that restores functionality of the app to what it was prior to this change

EDIT: the offer above is assuming this isn't a transient issue that'll resolve itself (as implied here). If this is the case and the issue goes away without the need for a patch, the $50 donation will be made to ReVanced via Open Collective

Acknowledgements

kyle0r commented 5 months ago

Q: Does anyone know off-hand if anyone can create a revanced patch or if its limited to a specific set of contributors?

I've read that reddit may of made a bad release, maybe its gets rolled back when they see the traffic drop off?

cite: reddit comment link

The apps still work Reddit is just having an outage: https://downdetector.com/status/reddit/

OR it might be targeted to kill off you know what. Multiple apps are reporting issues.

I've read that it might be related to useragent checks:

cite: reddit post comment link

nfinity dev said that the issue was caused by reddit blacklisting certain user agent headers. Infinity already has a fix, so 7.2.3 works. Just patch it and you're good.

cite: reddit post comment link

It happens with all third party apps. It seems that Reddit changed something in the way they process OAuth requests and that causes them to not be able to grab account stuff.

Infinity dev is already working to solve the issue on their app, not sure about Sync tho: https://www.reddit.com/r/Infinity_For_Reddit/comments/1d4aq9h/v723_is_coming_to_fix_the_posts_not_loading_issue/

posted just moments ago, cite: reddit post comment link

Sync's default UA string is as follows, which must be removed or changed:

android:com.laurencedawson.reddit_sync:vv23.06.30-13:39 (by /u/ljdawson)

So, hypothetically a revanced patch addressing the user agent might be the best way forward and have some users test and report findings.

oSumAtrIX commented 5 months ago

Refer to the linked PR

kyle0r commented 5 months ago

Latest from reddit comments:

I can confirm that it's working. I applied it manually with revanced cli. I can post the steps when I wake up tomorrow if anyone's interested.

kieraneglin commented 5 months ago

Looks like this is resolved! @OctoNezd I had a $50 USD bounty on this (via PayPal), but I see that @oSumAtrIX also contributed. Just let me know how/if you'd like to split it and also let me know your PayPal address and I'll get that done!

oSumAtrIX commented 5 months ago

I'm good, thanks

eiqnepm commented 5 months ago

How do I make ReVanced Manager download pre-release patches?

lucassilvas1 commented 5 months ago

How do I make ReVanced Manager download pre-release patches?

Did you figure it out?

OctoNezd commented 5 months ago

Hi, @kieraneglin

Due to conditions in my country I am unable to use PayPal. Can you send a donation using XMR or some other cryptocurrency?

kieraneglin commented 5 months ago

Hmmmm. This could be difficult. In my country most of the reputable crypto exchanges have shut down 😅

It's late here so I'm going to bed but I'll see if I can come up with something tomorrow!

kieraneglin commented 5 months ago

@OctoNezd actually I might still have some ETH or LTC I can access but I'll check tomorrow.

We should probably take this outside of GitHub issues. What's a better place to contact you? It could even be reddit or discord or whatever

OctoNezd commented 5 months ago

You can connect with me on Discord: my username is octonezd and you can validate it's me cause there is a verified link to my GitHub on Discord profile

oSumAtrIX commented 5 months ago

Please move somewhere else for discussion. We are signed up for notifications for issues and it's spamming our inboxes, thanks!

OctoNezd commented 5 months ago

Received bounty, thanks to @kieraneglin

smhc commented 5 months ago

FYI this issue has been resolved on the reddit server side without need for the client patch.

kieraneglin commented 5 months ago

Indeed, but the patch was merged so the issue is closed and the bounty was paid

smhc commented 5 months ago

I added the note for others who may be questioning the reason for the patch, or may need to revert it in the future if it causes problems.

kyle0r commented 5 months ago

FYI this issue has been resolved on the reddit server side without need for the client patch.

Care to share any details? I'd be interested to read/understand this situation and events.

OctoNezd commented 5 months ago

There isn't much to say about it: reddit started rejecting requests where the user-agent had the word "android" in them. Whether this was intentional or not - we don't know, but I suspect it might have been intentional and got reverted cause apparently it broke legitimate apps too.

On Sat, Jun 1, 2024, 10:11 Kyle @.***> wrote:

FYI this issue has been resolved on the reddit server side without need for the client patch.

Care to share any details? I'd be interested to read/understand this situation and events.

— Reply to this email directly, view it on GitHub https://github.com/ReVanced/revanced-patches/issues/3255#issuecomment-2143335739, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADUZM5DDVQOLVI2EX6JOWQTZFFX2LAVCNFSM6AAAAABIRUUA72VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBTGMZTKNZTHE . You are receiving this because you were mentioned.Message ID: @.***>