thumbnail fix - will this WORK THIS TIME? #154
Reference in New Issue
Block a user
Delete Branch "thumbnail-fix-1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
pls no conflicts thanks
You can update the same pull request next time, no need for a new one
Noted. (I have no idea how to use git other than pull & push)
@@ -0,0 +1,28 @@import path from 'path'import { promises as fs } from 'fs'export async function errorImageResponse(statusCode: number = 500): Promise<Response> {Why does errorImageResponse return Promise when it is already marked as
async? (I don't know if this is normal in javascript)ngl chatgpt wrote this entire file
Ok this is just how it's done in javascript
@@ -0,0 +6,4 @@const filePath = path.join(process.cwd(), 'public/errors', file)try {const buffer = await fs.readFile(filePath)Why are you reading a file into a buffer instead of using html?
I will get co-pilot to add this
My previous comment was a lie (maybe), in this case, the errors are specifically for thumbnails, and whatever files I had that used
errorImageResponsedon't exist since I messed up my local repo git stuffOh I see, it's returning the 404 image as a map thumbnail. So the logic here is populating the cache with the 404 image for that map.
Press "Resolve conversation" when you fix each one
Where is the image cache invalidated? Is the memory ever freed?
It never is, but shouldn’t be an issue yet since there’s only like 200 maps that would ever be in that cache. I’ll implement something to free the memory soon.
The maps on https://maps.staging.strafes.net/maps only show a few thumbnails for me, it adds a new thumbnail sometimes when I reload the page (not using the changes in this PR)

Merge as-is, or implement cache eviction and I can re-review
New commits pushed, approval review dismissed automatically according to repository settings
Once these changes are pushed to staging, it should fix the thumbnails issue. Hopefully.
-pray emoji
what happens if I approve
Edit: absolutely nothing it turns out
im a noob
GTFO
u suck wheres the mod website