Open janssen-io opened 4 months ago
Thank you,
I had that problem too for like a month that sometimes when i try to restart my bot it just instantly threw that 403. It usually fixed itself after some time.
But this little change worked perfectly
I created a fork where I fixed this, but because I'm not entirely sure this is fixing the root cause rather than a symptom, I didn't open a PR yet. For anyone else in need of this fix, there's a DLL in the Releases of the fork as well.
I then simply replace the DLL before I deploy my bot: https://github.com/janssen-io/ReviewBot/blob/9ade9d9f3c308001baf5ec208fcbc6e79950a384/.github/workflows/deploy.yml#L43-L46
- name: Patch Reddit.NET
shell: bash
run: |
wget -O "$RELEASE_DIR/Reddit.NET.dll" https://github.com/janssen-io/sirkis-Reddit.NET/releases/latest/download/Reddit.NET.dll
I figured that was the cause, thanks for the fix! Probably a good fix would be to fetch the access token when there is none cached, instead of relying on Reddit to return 401.
Thank you for the fix!
Awesome work! This fixes it for me. Thank you for making a fix available. Looking forward to a long-term fix
My hunch is that Reddit used to respond with 401 - Unauthorized and changed this.
Your hunch is correct. I really wish Reddit would notify SDK maintainers when they make BC-breaking changes like this. :/
Anyway, I'll put out a hotfix for this soon. Thanks for the heads-up!
My hunch is that Reddit used to respond with 401 - Unauthorized and changed this.
Your hunch is correct. I really wish Reddit would notify SDK maintainers when they make BC-breaking changes like this. :/
Anyway, I'll put out a hotfix for this soon. Thanks for the heads-up!
When can we expect a fix?
For a couple years now, I have a bot running smoothly thanks to this library. Unfortunately, since a few days now I started seeing 403 - Forbidden errors.
When troubleshooting using Fiddler, I found out that the token refresh in
Reddit.Models.Internals.Request
is never being hit. My hunch is that Reddit used to respond with 401 - Unauthorized and changed this. Now the conditional on line 174 is no longer true and thus the Access Token staysnull
.When I change the conditional to include
|| (res.StatusCode == HttpStatusCode.Forbidden
, the app works as expected again. :)