Commit graph

224 commits

Author SHA1 Message Date
535abec228 Oops, fix manually NC condition!
Oops, we weren't doing a good job encapsulating the different conditions in item search. The `OR` in the NC condition was causing a precedence problem!

Now, we wrap all the conditions in parens at the interpolation site, to make it really clear that they all need to be made safe like that!

Now, there's not a bunch of "??????" entries in NC search, oops 😅
2021-03-14 05:28:57 -07:00
bdc4cdf46b Use official PNG when available, instead of ours
This was one more bit that needed fixing for "Flying in an Airplane": it wasn't just the official SVG that was incorrect, but also the official SWF. So our converted PNG was also incorrect!

Here, we now try to use the official Neopets PNG when the manifest provides it, instead of our own.
2021-03-12 04:28:57 -08:00
0aaf1adb29 Add Support tool for OFFICIAL_SVG_IS_INCORRECT
Inspired by the "Flying in an Airplane" bug (item 82287), where the official SVG (and I think SWF) were visually glitched and included both zones in the image, but the official PNG was correct.

This flag lets us use the PNG, like the official player does—but only for this item, while still keeping SVGs for everyone else!
2021-03-12 04:01:35 -08:00
78354a35d0 Support ?v= for SVG URLs, too 2021-03-11 08:46:08 -08:00
f6f8d3200a Handle ?v= at the end of canvas library URL 2021-03-11 06:38:03 -08:00
dc3008a675 Okay, not _everything_ is on the new manifest URLs
Gonna have to start guessing stuff now!
2021-03-11 02:57:44 -08:00
e220b4e5e1 Whoops, biology still uses old manifest URLs
Huh. Okay! 🤷‍♀️
2021-03-11 02:35:13 -08:00
46066807ad Update to the new manifest URL format
I guess they dropped the hashes! Well, we're very behind on conversion now lol!
2021-03-11 02:16:42 -08:00
9f61250f05 Ignore unknown body IDs in item compatibility data 2021-02-22 20:00:38 -08:00
7ca548bae0 Wire up the NC support tool for real! 2021-02-22 19:37:24 -08:00
0ae26a6633 [WIP] UI for isManuallyNc support tool 2021-02-22 19:11:03 -08:00
c539471afa Add is_manually_nc flag
for items that are NC, but aren't marked with r500 on Neopets.com!
2021-02-22 18:05:44 -08:00
7183f0725c Add zone restrict to item page, too
I knew I was forgetting something! lol
2021-02-12 18:15:45 -08:00
614bad72d2 Show real zone data on item page
And some Cypress specs to test the basic cases!
2021-02-12 16:09:11 -08:00
2d0601cfeb Add total item count to search results
This will help us set up pagination!
2021-02-06 21:50:52 -08:00
922e150020 Extend itemSearch, deprecate itemSearchToFit
I'm gonna extend `itemSearch` to also look up the total number of results, and the fragmentation between `itemSearch` and `itemSearchToFit` finally caught up with me :p

I've deprecated `itemSearchToFit`, and moved the fit parameters into a new optional `fitsPet` parameter for `itemSearch`.

I'm going to keep `itemSearchToFit` around for now, because old JS builds still use it, and I'd like to avoid disrupting folks. But I'm not going to add the new total results field to the results object it returns, and that's gonna be okay!
2021-02-04 23:34:43 -08:00
927d783a96 Delete GQL query tests
I haven't been keeping these up to date, so at this point they're more overhead than they're worth.

Helpful in the early days when we were iterating fast and making more mistakes, but now we're more solid (and I learned how to just resend queries from devtools :p)
2021-02-04 21:24:53 -08:00
f3e19158d0 Fix crash when using old tab to load item page
Oops, the new `canonicalAppearance` arguments couldn't handle being omitted rather than being null, due to a low-level SQL call site that cares about the difference.

This meant that loading an item page in an old tab, with an old copy of our JS, could cause a crash.

Now, the backend will be okay with queries from old pages, and respond the same as before!

This isn't a huge deal, because once everyone is on the new JS we won't send queries without this parameter anyway… but I like my optional arguments to actually BE optional, without surprises lurking >.>
2021-02-03 15:51:49 -08:00
be151ab400 Save user's preferred color for item previews 2021-02-03 15:33:23 -08:00
787dc7da87 Save user's preferred species for item previews 2021-02-03 14:27:02 -08:00
a42e696955 Show selected color faces for SpeciesFacesPicker 2021-02-02 23:29:06 -08:00
19482be2b8 Use ES module syntax in backend instead of require
Ok cool, so apparently another win we get from using `ts-node` is that I can finally easily use some non-native-Node features like ES module import syntax, for consistency with what I'm doing in the main app source! That was getting on my nerves tbh. Ooh I bet I can finally use `?.` too, I've had to rewrite that a bunch…
2021-02-02 22:26:55 -08:00
4483df2040 Run Prettier on my TS file
VS Code wasn't running it automatically; now we've got it set up!
2021-02-02 21:40:43 -08:00
d7028bc2cc One more TS fix, adding a tsconfig.json 2021-02-02 19:29:58 -08:00
cb87fd8a9a more TS fixes 2021-02-02 19:22:47 -08:00
cee5e128cb fix TypeScript build errors
That's what I get for forking a TS file, not knowing TS, and ignoring the errors lol :p
2021-02-02 19:20:02 -08:00
d3b9f72e67 Add stale-while-revalidate cache headers
Oh yay, I'm pleased with this! I hope it works out well!

stale-while-revalidate is an HTTP caching feature that gives us the ability to still serve relatively static content like item pages ASAP, while also making sure users generally see updates quickly.

The trick is that we declare a period of time where, you can still serve the data from the cache, but you should _then_ go re-fetch the latest data in the background for next time. This works on end users and on the CDN!

I've scanned the basic wardrobe and homepage stuff and brought them up-to-date, and gave particular attention to the item page, which I hope can be very very snappy now! :3

Note to self: Vercel says we can manually clear out a stale-while-revalidate resource by requesting it with `Pragma: no-cache`. I'm not sure it will listen to us for _fresh_ resources, though, so I'm not sure we can actually use that to flush things out in the way I had been hoping until writing this sentence lol :p
2021-02-02 19:07:48 -08:00
c00df62bdc More cache hint tags for Item etc
Trying to get that Item page fast!

I don't really want to ship this as-is, because I'd really like to get stale-while-revalidate working before shipping a 1-week cache timer… will be tricky though!
2021-02-02 17:51:54 -08:00
cdff51dfef Hook up compatibility data for SpeciesFacesPicker
It looks really nice!! :3
2021-02-02 15:22:08 -08:00
701eb33391 Add "Items you own" and "Items you want" filters 2021-01-21 15:58:24 -08:00
2164f06021 Add --resync-existing to cache-asset-manifests
Wowie, looks like all the SVG asset manifests changed format lol! Running this now to update them all. There's a lot of them!
2021-01-21 15:14:23 -08:00
f40ccf0b21 Fix bug where we weren't recognizing new SVGs
So, we've been behind the latest conversion data for a while anyway, because I don't run the sync very often. But I ran the sync today and noticed that the newly converted SVGs weren't showing up in DTI!

This is because TNT changed the asset manifest structure they use for SVG-only assets. Now, we support both!

To test, I checked the Blue Acara (old-style SVG manifest), the Blue Chia (new-style SVG manifest), and the Floating Negg Faerie Doll (animated clip).
2021-01-20 10:44:32 -08:00
275d1d62ab Add secret HTML5 conversion page at /conversion
A lil page for us to keep track of Neopets's HTML5 conversion progress!
2021-01-20 10:44:29 -08:00
94efb80e65 Handle bugs in neopets username data
Huh, looks like it's possible for a user's NeopetsConnection record to be missing, despite having the ID on their User record!

Here, we handle that case.
2021-01-19 13:55:25 -08:00
b39914976b Add an /items/search page, and search box on Home
Woo, it's looking pretty good, I think!

I didn't bother with pagination yet, since I feel like that'll be a bit of a design and eng lift unto itself... but I figured people would appreciate the ability to look up individual items, even if the rest isn't ready yet 😅
2021-01-18 15:56:24 -08:00
334d89c101 Add Latest Items section to homepage 2021-01-18 06:31:27 -08:00
e149d53595 Back links to Your Outfits, *if* it's yours
Previously, when you clicked on a saved outfit from Your Outfits, the back button would take you back to the homepage, which was confusing for scanning through stuff! Now, it goes back to Your Outfits if it's yours.

I'm not suuure this is the behavior we want? But it seems intuitive enough!
2021-01-17 08:04:21 -08:00
33ee4455a7 Gracefully handle unexpected SWF URLs
Fixing our support for our "Totally Legit DTI Graffiti" item 😅

In addition to this change, I also uploaded the images to the correct URLs: the old site was doing the folder algorithm in a surprising way, yielding https://impress-asset-images.s3.amazonaws.com/object/000/000/0-1/-1/600x600.png, whereas the new site was doing the (imo clearer) https://impress-asset-images.s3.amazonaws.com/object/000/000/000/-1/600x600.png. I copied the files to the new location.

I also noticed that the thumbnail URL for that item has been broken for a while, so I created a new copy at https://impress-asset-images.s3.amazonaws.com/object/000/000/000/-1/80x80.png, and updated the database record to point to it.

This should resolve Sentry error IMPRESS-2020-6.
2021-01-17 05:16:53 -08:00
cdf2c66686 Oops, remove extra console.log statement! 2021-01-05 23:36:54 -08:00
5865157a1b Fix crash when there are too many trade matches
Oops, the GROUP_CONCAT string was getting cut off! This caused an error trying to look up the name of an item ID that didn't exist, because the ID got truncated partway through.
2021-01-05 23:35:02 -08:00
4a352e04e0 simulate login with IMPRESS_LOG_IN_AS flag 2021-01-05 23:22:03 -08:00
b01feba038 add items to outfit thumbnails
Now that wasn't so hard! :3
2021-01-04 08:26:05 +00:00
30e0a149be basic outfits page with pet-only thumbnails 2021-01-04 08:10:35 +00:00
b8d919b247 basic outfit data from GQL 2021-01-04 07:36:00 +00:00
e0af75d927 outfit-images: render actual PNG and SVG layers! 2021-01-04 05:58:19 +00:00
d875b5f6ce outfit-images: use node-canvas to render image 2021-01-04 04:17:32 +00:00
385c476ae8 outfit-images: placeholder function and test! 2021-01-04 04:17:09 +00:00
fd864ab8ec fix cache-asset-manifests script
Just wanted to run it and see if much has been converted since we last checked!
2020-12-28 14:00:11 -08:00
f09c17e2f5 oops, fix empty matches bug on seeking page!
I fixed a bug in `itemsTheyWantThatCurrentUserOwns`, but forgot to fix it in `itemsTheyOwnThatCurrentUserWants`!
2020-11-25 02:09:03 -08:00
def46b0d9c add matches to the trades list page when logged in 2020-11-25 01:53:42 -08:00