Commit graph

237 commits

Author SHA1 Message Date
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
9af6fd2d82 add comment explaining db index for trade activity
This query was very slow! I added an index, and now it's fast!

This code change doesn't actually affect anything, but the comment helps explain what happened, since the index isn't stored in code. (Todo: should I start defining some indexes in our setup files?)
2020-11-24 21:56:29 -08:00
8a06ac7fb9 perf upgrade for UserItemsPage
I knowingly wrote this less performant at first. And indeed, it was slow—like 2sec of main thread time! Turn that O(mn) into O(n) pls!
2020-11-24 21:03:45 -08:00
c23243fcb7 add real timestamp to trades page 2020-11-24 14:43:43 -08:00
54abd1ac80 real trade data on the page! 2020-11-24 14:24:34 -08:00
3b4d2ac390 fix user items page crash for item w/o zone data 2020-11-18 10:35:25 -08:00
d219750ea1 support can look up users by email, not just name 2020-11-18 10:32:49 -08:00
7c9313f4a6 support tool to edit usernames 2020-11-18 07:42:40 -08:00
6a43f92438 can search for user by name from items page 2020-11-18 06:45:33 -08:00
f1a8277c22 simplify offering/seeking count query 2020-11-09 06:30:20 -08:00
68e6e9e243 add real offering/seeking counts to item page 2020-11-09 06:26:29 -08:00
02e173d7de nc/np/pb search filters 2020-11-08 15:04:17 -08:00
f6723bb67a fix edge case bugs in itemByName and itemsByName
not-found case was erroring instead of returning a simple null, and string trimming wasn't working right, oops!
2020-11-08 00:20:21 -08:00
f621391446 add itemByName and itemsByName GQL 2020-11-08 00:06:51 -08:00
3171d8095a add isPb to item GQL 2020-11-03 19:46:18 -08:00
15f10c615b add descriptions to closet lists (formatted! :3) 2020-10-28 00:00:14 -07:00
4e00962edc add individual lists to user items page 2020-10-27 23:09:42 -07:00
21039ec148 add GQL for individual trade lists 2020-10-27 22:32:37 -07:00
a49e66e359 fix bugs in auth mocking for tests 2020-10-27 22:16:34 -07:00
f832cb9acb oops, fix crash when no neomail contact exists 2020-10-24 00:11:56 -07:00
274a4f716f add zones to user items page
idk the labels section was feeling empty, and I didn't see a way to streamline it more, so I figured, add info that might be useful! lol
2020-10-23 23:29:54 -07:00
53d399f46b add neomail username to user GQL 2020-10-23 22:55:13 -07:00
851e6201eb remove svgUrl logging
this has sorta become log noise, now that we have support for the movie assets and stuff, and we know we're pretty reliable overall
2020-10-23 22:45:35 -07:00
3a20deba09 can remove owned/wanted items from item page 2020-10-23 22:43:56 -07:00
e7cc20876b use xmlrpc to load pets, not json.php
The AMFPHP gateway's json.php endpoint has always had a problem parsing pets whose names start with digits… I've dug into it before, and checked again today, and there really is just no way around it: d584b58e95/core/json/app/Actions.php (L43)

And there aren't any reliable AMFPHP Node libraries out there to make the actual native AMF call.

Buuuut! In today's investigation, I noticed the xmlrpc.php endpoint for the first time. And, wouldn't you know it, there's //great// reliability for something as enterprise-standard as that!

So here, I've switched over to using an xmlrpc client library, which simplifies our calling code //and// makes number pets work correctly 😁 I wouldn't have done it just for the simplification, I think bringing in a library is net more complexity… but getting this finally right is a big relief.
2020-10-22 23:22:04 -07:00
dd4f34ef73 mutations to mark an item as owned/wanted 2020-10-22 20:35:06 -07:00
acdf6209ca extract server auth into auth.js
This is just a nice cleanup, but it also supports a test mock I want to do next, to mock logins for the test db without having to round-trip to auth0.
2020-10-22 19:53:10 -07:00
2578e1a431 disable new modeling code, until some future day
Yeah, mm, turns out I don't think it's actually viable to model from Impress 2020, because we can't reasonably set up the SWFs and PNGs in the ways we need, especially for compatibility with Classic DTI.

We can turn this on again later, once Classic DTI is gone, and all assets are converted to HTML5 -- or if we build some kind of bridge to Classic's asset code, or we write new PNG conversion code.
2020-10-07 07:49:27 -07:00
5b2e370295 oops, fix a missing await in modeling
This caused swf asset syncs to be unreliable!
2020-10-06 07:35:00 -07:00
900d102594 Merge branch 'modeling' into main 2020-10-06 07:06:30 -07:00
99e6480486 add logging to modeling
my hope is that, if we fuck things up, this will make it clear 😅
2020-10-06 07:06:19 -07:00
bb812a2b81 oops, fix bug modeling pet with no items 2020-10-06 06:38:21 -07:00
6ec6bbec57 first-time modeling UX improvements
These changes are most relevant for playing around in the dev server, modeing against an empty database. But they'll also help in real-world modeling scenarios! e.g. modeling a new species/color combo is now a bit nicer, we don't show a blank entry in the color picker
2020-10-06 06:37:51 -07:00
df2d814c13 enable running against a local dev database
had to add some missing tables, but it seems to work! (some known errors though, from assumptions we make e.g. blue acaras existing)
2020-10-06 06:18:19 -07:00
da72837d9e modeling saves item-to-asset relationships
this is the last one to get parity with current modeling, I think?? I'm gonna add one more feature though: removing no-longer-used assets from the item
2020-10-06 05:49:37 -07:00
fefb798e87 extract Pet GQL to Pet.js from Outfit.js 2020-10-06 05:04:44 -07:00
740d8415db extract modeling logic into modeling.js 2020-10-06 05:02:21 -07:00
68b5486bb7 update labeled field for pet appearances
Oops, when building the Support tool to label pet appearances, I didn't realize that there's also a boolean `labeled` field that needs to be true for labeled appearances. Without it, the old app shows the appearance as "Unlabeled".

I also ran this query to fix the rows we'd incorrectly written:
```
mysql> UPDATE pet_states SET labeled = 1 WHERE mood_id IS NOT NULL;
Query OK, 158 rows affected (0.14 sec)
Rows matched: 19640  Changed: 158  Warnings: 0
```
2020-10-03 04:05:25 -07:00
0f5c437ffd split up modeling code into smaller functions
This is mostly because I want to chain the rels after both items and assets save, and I want to be able to specify that stuff a bit more precisely, rather than the like, layers-of-awaits we were building up.
2020-09-27 03:57:14 -07:00
a8c351b102 oops, fix a bug with Pet name GQL 2020-09-27 03:21:07 -07:00
914a06f8c7 add test for UC modeling
This got fixed in the refactor last commit, where we added the petAppearance field!
2020-09-27 03:19:10 -07:00
e57af14625 refactor Outfit.js to split Pet to a separate type
yeah, I had unified Pet into Outfit, but now I think that was overly clever… 😅

Here, I define a new Pet type, and it has some of the fields of Outfit and the deprecated fields still.

I did this because I want petAppearance to work, for UC testing!
2020-09-27 03:18:46 -07:00
94f6363251 add LIMIT 1 to our updates, out of healthy fear
This is just me thinking about what could go wrong in the modeling rollout,

this at least makes it so that, if something breaks, it will break small
2020-09-25 05:15:58 -07:00
cc5a8a6fab set bodyId=0 when item's body id changes
that is, if we see an item modeled on a second body, then treat it as body 0
2020-09-25 05:04:12 -07:00
96a126ebba oops, stop sending unnecessary inserts/updates
got the types wrong on some stuff, and got pet state sorting wrong!
2020-09-25 03:29:02 -07:00
41e70ba8d0 finish modeling full pet appearance 2020-09-25 03:29:02 -07:00
50537758c5 start test/dev db IDs at 1, not wherever prod is
We download the schema from prod, and omit real data, but I didn't notice that we were still pulling the metadata of the auto increment counter for IDs! Now, we scrub that from the schema file we save.
2020-09-25 03:29:02 -07:00
71f491ce65 modeling saves pet state 2020-09-25 03:29:01 -07:00
5332c9e265 save biology assets on model
and start in comments on pet states :)
2020-09-25 03:29:01 -07:00
ff3fc943d7 modeling saves pet type 2020-09-25 03:29:01 -07:00
9111dfddd3 save item swf assets during modeling 2020-09-25 03:29:01 -07:00
f7d9faa265 update modeled item data 2020-09-25 03:29:01 -07:00
8793d8b570 refactor modeling code a bit to use syncToDb fn 2020-09-25 03:29:01 -07:00
d27395bda2 hooray, animated items seem to be working?! ^w^ 2020-09-22 03:53:48 -07:00
1b59b9631b GQL for canonical appearance for body
gonna use this for item page! I walked back my supported species idea 😅
2020-09-21 02:56:48 -07:00
bcf6e6d8a7 add GQL to know what species can wear an item
gonna use this on the item page to seed the species choice!
2020-09-20 21:33:45 -07:00
dc785b063e remove detailed gql from honeycomb traces
This wasn't actually super helpful to read anyway, and I think it was causing us to hit rate limits.

We can maybe add back a limited version to like, add path context of _where_ a span happened in the GQL tree, but like, I feel like that's typically been pretty intuitive so far.
2020-09-19 21:34:35 -07:00
dfeeb9fe0d modeling will save new item data (but not assets)
just a first step!
2020-09-18 07:34:41 -07:00
07691a4e6b add basic test db infra
Boom, now we can also run a clean MySQL test db on each test that wants it :)

the test I wrote as a sample is currently marked `it.skip` because it's not passing yet!
2020-09-18 05:50:17 -07:00
ffeb494f45 add created at date to item page
this will help me notice which items are new! lol
2020-09-15 04:15:15 -07:00
57c0981472 ah oops, dont use syntax that prod doesn't support
right, dev supports `?.` syntax, but prod builds don't. I keep forgetting that!
2020-09-15 03:27:41 -07:00
c3c8d924b5 add other colors to modeling GQL 2020-09-15 03:06:17 -07:00
32822b250d add colors to modeling query, no change to gql yet
This updates the MySQL procedure to get the important special colors, but keeps the GQL behavior the same by only filtering to Blue. Just an incremental step before changing the behavior, to make sure I've gotten it right so far!

Snapshots significantly updated, but, from scanning it, I think that's expected changes from actual modeling progress. Hooray!
2020-09-15 02:38:23 -07:00
0b724f7509 add own/want badges to items in wardrobe 2020-09-12 20:02:56 -07:00
45ffa92f1d add itemsTheyWant to user GQL 2020-09-11 21:34:28 -07:00
c0f0e5688c include item lists in itemsTheyOwn
This adds the owned items to the user items page, and also means that owned items in lists will be tagged for the modeling page
2020-09-11 21:23:14 -07:00
5a91dd2f2a in-memory cache for modeling query
I'm using my first ever MySQL Store Procedure for clever cleverness in caching the modeling query!

I realized that checking for the latest contribution timestamp is a pretty reliable way of deciding when modeling data was last updated at all. If that timestamp hasn't changed, we can reuse the results!

I figured that, because query roundtrips are a bottleneck in this environment, I didn't want to make that query separately. So, I built a MySQL procedure to do the check on the database side!
2020-09-06 15:49:08 -07:00
f73211a50e add GQL endpoint for items that need models 2020-09-06 02:50:04 -07:00
655a7e281c remove "As a reminder" from a support notif
Oops, I meant to remove this from both PetAppearance mutation loggers, but I guess I only removed it from one!
2020-09-06 02:11:58 -07:00
3512418a66 refactor GQL typedefs/resolvers into separate files
get that giant index file broken up a bit!
2020-09-06 02:11:22 -07:00
453953dded simplify validPetPoses out of the server directory 2020-09-06 00:40:00 -07:00
Matchu
e2b5486168 GraphQL for user's itemsTheyOwn 2020-09-04 05:57:21 -07:00
dac7a682d4 oops, I broke the cached data script 2020-09-02 23:19:50 -07:00
ba004ae656 oops, fix build errors from using future syntax
worked in some local contexts, but the prod build failed!
2020-09-02 23:07:44 -07:00
12b87ee7d1 set up auth on the server + test utils 2020-09-02 23:00:16 -07:00
f3013c2956 add basic user data to GraphQL API 2020-09-02 16:09:11 -07:00
6982f00729 script to export users to auth0 2020-09-02 03:49:58 -07:00
99feddb859 fix pagination ish
Okay, we handle the new pages correctly! Still some weird bugs when you send requests near each other? Probably wise to migrate to Apollo's new way of doing this
2020-09-01 20:30:18 -07:00
a11ff1326b actual zone search support? owo 2020-09-01 20:06:54 -07:00
bf465d802e item searches by word, not phrase
Been bothered by this for a while!

My hope is that this isn't a notable marginal performance hit—we were already walking the table and doing string ops anyway, I can't imagine adding to that is actually that much of a marginal lift, when the main bottleneck was probably reads. And the perf should be identical for simple single-word queries anyway. But we'll see how it feels!
2020-09-01 17:35:41 -07:00
b7c958c39b don't restrict zones if the item is not compatible
Previously, if you switched species/color such that one of your items was no longer compatible, we _would_ still apply its zone restrictions to the visible layer set.

In this change, we fix that server-side, since I think it makes the most sense for an empty appearance to be truly empty!
2020-09-01 17:00:27 -07:00
3a6e3fac8e add isCommonlyUsedByItems to Zone
This is in preparation for hiding bio zone restrictions but showing item zone restrictions!

I also refactor the build-cached-data script substantially, to run GraphQL against the server instead of a custom query.
2020-09-01 01:16:30 -07:00
6dc53814c2 move restrictedZones from layer to PetAppearance
okay so the PetAppearance restrictions are stored on the asset, because that's how they're defined on Neopets.com too

but I think that's a confusing API, so here I define `PetAppearance.restrictedZones`, which just maps over the layers and aggregates the zones server-side, same as we would have done on the client

I think that's much easier to understand than having layer contain a field, but having to know that item restrictions _don't_ work that way, you know?
2020-08-31 23:18:30 -07:00
d91cd80603 add support for UC zone restrictions 2020-08-31 19:23:56 -07:00
856d8586e4 cache item data when switching standard colors
Previously, when changing a pet's color, we would refresh the items panel and send a new network request for the item appearances, even though they're all the same. This is because item appearance data is queried by species/color, for ease of specification.

But! Item appearances are //cached// by body ID. So, if this is a standard color, it's not hard to look in the cache for the standard color's body ID!

Now, most color changes are faster and don't flicker the item panel anymore. We do still refresh the panel and send the requests for color changes that _do_ matter though, like standard <-> mutant!
2020-08-31 18:25:42 -07:00
4a91d0cab8 include glitched states for validPetPoses
ahh, in a recent change I made glitched states valid for canonical poses, but didn't make the corresponding change here! This meant that I think the PosePicker showed them, but other ways of getting to them didn't work, including the Candy Acara (who is 100% marked glitched) was no longer pickable at all
2020-08-31 17:46:11 -07:00
214a93008b don't cache poses for Support tool
I noticed in prod that the Vercel edge cache can show old data in the Support tool right after you edit it and reload the page, which is super confusing!

In this change, we stop caching the endpoint we use for Support tools, so that the Support tools always feel real-time and trustworthy. (The standard pose picker might still be cached, so it could be a bit confusing for that to be out of sync, but at least you can toggle into Support mode and see that your changes happened _there_, so you don't panic that they're _gone_.)
2020-08-31 01:17:18 -07:00
2cc643fd4c remove discord support log thumbnail note
It's helpful, but they were making the log messages too tall imo, esp when you consider they'll often come in label batches
2020-08-31 01:10:18 -07:00