Commit graph

1174 commits

Author SHA1 Message Date
f2fd019aa8 Remove unused IMPRESS_LOG_IN_AS feature
The latest version of Yarn's shell interpreter wasn't playing nice with
this undefined variable; okay! It's unused, let's just delete all
trace of it!
2024-01-28 06:36:09 -08:00
106fcf075f Use the same dev database credentials as the main impress app
This should make it easier to test both apps working together!
2024-01-28 06:32:46 -08:00
4cd5cf5800 Fix handling of assets with https://images.neopets.com/temp SWF URLs
Weird! Well! This caused two issues.

One is that we used to filter down to only assets whose urls end in
`.swf`, because I never added support for the sound ones :p

The other is that we were using the SWF URL to infer the potential
manifest URLs, which we can't do when the SWF URL is a weird
placeholder!

Thankfully, just yesterday (wow!) we happened to have Classic DTI keep
track of `manifest_url` during the modeling process, and we backfilled
everything. So the most recent `temp` assets have their manifest! But
slightly older ones (not that old tho!!) didn't, so I manually inferred
the manifest URL from the asset's `remote_id` field instead (which
worked cuz there was no hash component to the manifest URL, unlike some
manifests).

The item "Flowing Black Cloak" (86668) on the Zafara is the one we were
looking at and testing with!
2023-11-11 13:28:47 -08:00
c3a9c24d22 Fix pet loading
Needed to add some headers to satisfy StackPath etc!

(Also, latest Prettier ran on this file for the first time, so a few
changes there too!)
2023-11-06 13:24:08 -08:00
3b6bc0b6eb Oops, add Vary: Origin to GraphQL requests
Lol I guess we've probably just been having intermittent CORS issues
forever, oops. I hope the cache has been mostly warmed on the right
thing! But today I checked and the entire species/color picker on the
Rails app wasn't working for CORS reasons, so like. Yeah oof.
2023-11-02 16:35:11 -07:00
a2594d1797 Fix crash on user lists page from orphaned hangers
If you delete a closet list without deleting the items in it, it'll dump them into your default own/want lists. This isn't necessarily the behavior we really want, but oh well, that's the truth right now!

The GraphQL endpoint was assuming that all hanger `list_id` values were valid, oops! Now, we ignore list IDs that don't match a list.
2023-10-24 14:48:55 -07:00
53deee85dd Use MajorErrorMessage on user lists page
There's an error here that I'm trying to fix, first I'll make the error message nicer for people!
2023-10-24 14:43:43 -07:00
76dd8059bb Extract IMPRESS_MYSQL_HOST environment variable
Oh beans, I made an env variable change that I thought would switch us over to db.impress.openneo.net, and I was just plain wrong, darn. impress-2020 has been fully failing since then, oops!!!

Here, we change it to be an environment variable, so that in the future it will work how I want it to lol
2023-10-12 20:45:06 -07:00
a5dcf369bb Point the update link to the Pardon Our Dust page 2023-10-12 18:13:11 -07:00
a14bc9bebd Fix Vary header for CORS
Oops, we added behavior that varies the CORS response headers according to the incoming `Origin` header, but we forgot to add `Vary: Origin`!

This doesn't cause an issue for the app when you make requests to the server directly, but since it's behind a Fastly cache layer, we ended up caching responses that didn't include CORS headers but should have.

Now, this will instruct the Fastly cache to treat requests with different `Origin` headers as being entirely different. (This means we won't be sharing caches between requests from impress-2020 and the Rails app anymore, but that should be okay in practice!)
2023-10-12 14:58:26 -07:00
e31a79e793 Merge branch 'main' of github.com:openneo/impress-2020 2023-08-29 15:06:43 -07:00
756ee8dcb2 Add workaround for pet lookups with leading digits
This was Dice's idea ty!! Now, instead of crashing when looking up any pet whose name starts with a number, we do a clever lil workaround instead! We don't get *all* the data back (we're missing metadata), but that's fine for the main use case of typing your pet name in at the homepage.
2023-08-29 15:05:19 -07:00
80428e9834 Fix pet loading for most pets
Sigh, I guess xmlrpc was deleted? Back to the method that doesn't work for pets with leading digits in their names, sobbe

Dice has a neat idea for how to work around that, but I'm not sure how to fit it in our architecture, let's take a look!
2023-08-29 14:40:59 -07:00
85d68f68e1 Enable Classic DTI to access impress-2020 via CORS
owo, uwu,
2023-08-20 15:40:21 -07:00
f54ea61854 Merge branch 'state-of-dti-2022' into main 2023-03-23 21:54:53 -07:00
c28475fcdc Add a big callout link about the State of DTI message 2023-02-04 23:59:18 -08:00
e5e368fb65 More honest language in the homepage "beta" module 2023-02-04 23:49:25 -08:00
4287f12912 Update "State of DTI" message copy & URL 2023-02-04 23:48:55 -08:00
f2832a3bde Logic & comment updates to #30
Tested this out and compared to Dice's other work in Neobot and I think the condition should be the other way around, as it is here? (I found myself starting to write the explanatory comment, and realizing it wasn't making sense, then going heyyy wait a minute lol)
2022-12-22 18:58:49 -08:00
60d2f9a014 Merge branch 'main' of github.com:matchu/impress-2020 into main 2022-12-22 18:49:29 -08:00
722f6b55a5
Tweak layer algorithm for bio overrides 2022-12-12 08:50:38 -05:00
14c6e5a8be State of DTI 2022 letter
not linked anywhere yet, just the page itself created!
2022-12-12 01:46:27 -08:00
5f7a17b244 Fix typo in terms page title 2022-12-12 01:26:10 -08:00
22784555d9 Use small pagination toolbar in wardrobe
I thought about making this by media query, but tbh I think this looks better at the larger sizes too?
2022-10-14 20:45:28 -07:00
edce95ec3b Oops, also resize pagination toolbar dropdown 2022-10-14 20:44:57 -07:00
3dfc53cda1 Add basic search results to footer
It looks bad, and only shows page 1, but it does stuff at all! :0
2022-10-14 20:40:06 -07:00
a83e3a9e0b Share search query state between panel and footer 2022-10-14 20:29:57 -07:00
c564400223 Oops, don't mess up mobile with search footer! 2022-10-14 20:26:07 -07:00
589e6c35b4 Hide other search bar when search footer is visible 2022-10-14 20:24:26 -07:00
eb18fd54b6 SearchFooter visual tweaks
Finally playing with this, now that we've been doing paginated search results in the main element! Let's see how it goes 😳

I made a thing to make the pagination toolbar smaller (might want to do that on the mobile view too?), and also to put the search suggestions in a popover floating at the top of the search box.
2022-10-14 20:16:06 -07:00
78d8cf3739 Preload the prev/next item search pages
I tried to do this earlier, but the caching problem from the previous commit (where we weren't including `id` for the search result in the GQL query) was causing it to do a like, infinite loop thing, where the preload results would cache-invalidate the current results, and so the 3 queries would just fight for which one's in the cache?

But now that caching is working, this is working too! Makes it all feel a lot snappier :3
2022-10-14 19:41:52 -07:00
2ee48250da Fix caching for search result pages
Apollo Client is pretty darn reliant on an `id` field for effective caching, more often than you'd think!

Before this change, navigating back to a page you'd already loaded would cause it to reload. After this change, it no longer does, and serves the page from cache instead!
2022-10-14 19:38:26 -07:00
a9aeab12a3 Scroll to top when item search page number changes
We also didn't need the query one, because we now `key` the `SearchResults` by the query, so the container becomes empty-then-full-again, which resets scroll back to top.
2022-10-14 19:33:45 -07:00
45b0aba736 Fix comment 2022-10-14 19:27:05 -07:00
6be5dd74d3 Homepage update: item search pagination 2022-10-14 19:21:55 -07:00
4cdfff03d1 Use pagination instead of infinite scrolling
idk this has been a long-time popular request, so I'm just gonna like. throw it all the way out there. and see what people think of it

I'm a bit worried it might change up the mobile experience too much? But like. let's find out!
2022-10-14 19:19:56 -07:00
ca58bc1be3 Refactor URL routing out of PaginationToolbar
in preparation for PaginationToolbar being able to support other kinds of state!
2022-10-14 18:27:44 -07:00
98e89e4302 Refactor router pagination into a hook
My intention is to move this out of PaginationToolbar entirely, so that it becomes a component we can reuse in a non-URL-state setting. (I'm looking at using pagination for the wardrobe item search is why!)
2022-10-14 18:01:31 -07:00
9a54694e31 Remove Metaverse license notice
It's covered in the Terms now, and I don't think they can reasonably claim they didn't know, lol
2022-10-14 17:44:26 -07:00
8b3c256a5c Time out manifest requests after 2sec
We do a thing where we sometimes proactively update an appearance layer's manifest from images.neopets.com when it's been a while since the last time, _during_ user requests.

But when images.neopets.com is being slow, this makes our API requests about appearances super slow, too!

In this change, we add a 2-second timeout to those requests. That should be plenty for when images.neopets.com is in a good mood, but also give up fast enough for the site to not feel miserable lol :p (especially when the use "Use DTI's image archive" option is on!)
2022-10-13 17:00:21 -07:00
4619e86ae0 Add "Use DTI's image archive" option
just a lil thing for people to turn on if it gets truly miserable again!!
2022-10-13 16:44:20 -07:00
5e6939309a Replace imageUrl with imageUrlV2 in-app
Should be a smooth drop-in replacement, we give the field an alias `imageUrl` in the query, so the rest of the app is none the wiser!

I didn't test the layer upload cache invalidation, but it seems pretty obvious to me, so ehh I'm just shipping it lmao
2022-10-12 12:41:27 -07:00
3428254318 Simplify modeling output when there's no items
This'll both hide sections that are empty (which just wasn't plausible for a long time), and print a happy lil message if there's no sections to show at all!
2022-10-12 12:09:15 -07:00
0a99668f00 Remove Modeling link from global header
We seem to have everything modeled now, and we have automatic modeling, so like… this is not a useful link for the general public anymore!

Instead, we'll just keep it a secret for us to check on the state of things!
2022-10-12 12:03:53 -07:00
1b0a6c8385 Mention automatic modeling on the homepage 2022-10-12 11:57:28 -07:00
a1844f76e0 Add /api/assetImageRedirect
Okay, this is gonna be a drop-in new backend for impress-asset-images.openneo.net, to enable Classic DTI to use the same images as DTI 2020!

This will enable us to stop generating images and uploading them to S3 just for Classic's sake, so we can turn those background processes off! And the new modeling script skips that anyway, so this is an important compatibility step for the new data that went out today!
2022-10-11 12:21:14 -07:00
29d9d498bf Use aws.impress-asset-images.openneo.net
We're gonna update impress-asset-images.openneo.net to perform redirects and stuff, so Classic DTI can start using the same images that DTI 2020 does.

That should enable us to stop relying on AWS for images, which is important because the new modeling script breaks that anyway :p but this will also let us turn off the image converters that run in the background all the time, and I'm excited for that too!
2022-10-11 12:19:39 -07:00
e8d7f6678d Auto-modeling script??
It seems to be working!! How exciting!! I'm just letting it run on stuff now :3

One important issue is that Classic DTI doesn't show images for items modeled this way, because we don't download the SWFs for it. But I wanna update it to stop using AWS anyway and do the same stuff 2020 does, I think we can do that pretty sneakily!
2022-10-11 11:13:10 -07:00
052cc242e4 Modeling page performance fix
Ok so, I kinda assumed that the query engine would only compute `all_species_ids_for_this_color` on the rows we actually returned, and it's a fast subquery so it's fine. But that was wrong! I think the query engine computing that for _every_ item, and _then_ filter out stuff with `HAVING`. Which makes sense, because the `HAVING` clause references it, so computing it makes sense!

In this change, we inline the subquery, so it only gets called if the other conditions in the `HAVING` clause don't fail first. That way, it only gets run when needed, and the query runs like 2x faster (~30sec instead of ~60sec), which gets us back inside some timeouts that were triggering around 1 minute and making the page fail.

However, this meant we no longer return `all_species_ids_for_this_color`, which we actually use to determine which species are _left_ to model for! So now, we have a loader that also basically runs the same query as that condition subquery.

A reasonable question would be, at this point, is the `HAVING` clause a good idea? would it be simpler to do the filtering in JS?

and I think it might be simpler, but I would guess noticeably worse performance, because I think we really do filter out a _lot_ of results with that `HAVING` clause—like basically all items, right? So to filter on the JS side, we'd be transferring data for all items over the wire, which… like, that's not even the worst dealbreaker, but it would certainly be noticed. This hypothesis could be wrong, but it's enough of a reason for me to not bother pursuring the refactor!
2022-10-10 20:15:16 -07:00
07e2c0f7b1 Add the /donate page
Just doing some house-cleaning on easy pages that need converted before DTI Classic can retire!
2022-09-25 08:05:38 -07:00