fix(ui): Refactor and improve XHR for empathy and post deletion#306
Merged
fix(ui): Refactor and improve XHR for empathy and post deletion#306
Conversation
with apologies to the TSX version
for some reason (probably Nintendo's domain whitelist) we can only GET and POST. so override it on the server side
nice server-style typed wrapper around it
this works fine on ctr and is a bit neater
mrjvs
requested changes
Jan 23, 2026
Contributor
mrjvs
left a comment
There was a problem hiding this comment.
Tested everything, looks like everything is working. Just a couple review comments.
Also TIL: You can't delete replies on 3ds
the old method was broken after TSX since it strips the empty src= attribute, and this is just cleaner anwyay
mrjvs
reviewed
Jan 26, 2026
Contributor
mrjvs
left a comment
There was a problem hiding this comment.
Code looks good, I'm waiting on the moderator team to give some feedback on the redirect changes before I approve
mrjvs
previously approved these changes
Jan 26, 2026
Contributor
mrjvs
left a comment
There was a problem hiding this comment.
The mod team agreed with this approach, so this is good to merge I think
Member
Author
|
Waiting for #306 |
Contributor
Segmentation fault (core dumped)
Process exited with exit code 139 |
mrjvs
approved these changes
Jan 28, 2026
Contributor
mrjvs
left a comment
There was a problem hiding this comment.
(yes, I am approving my own commits now)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #XXX
Changes:
Refactors how XHR is handled in the client JS. This was initially intended as a CTR fix for the Cloudflare XSS trip, but the error handling was improved enough to justify porting it to all platforms.
Thankfully, due to the bundler modernising CTR's syntax a lot, it's tolerable to just copy-paste the code between the three, with the only big issue being var/const.
onloadworks - it's old Chrome, not IE6!)This touches the post templates to remove the
onclickhandlers, so #295 will need equivalent changes to the TSX versions.The XHR and API files are near-identical between platforms, so a good candidate for a
@repo/client-commonlibrary. Food for thought.