Commit graph

2220 commits

Author SHA1 Message Date
1bfacf0340 Upgrade protocol-rack gem, remove workaround
Previously, having this gem at the latest version was causing problems when booting the app: https://github.com/socketry/protocol-rack/issues/20

This is no longer the case. Goodbye, workaround!
2025-07-26 09:58:24 -07:00
e0b2f6654f Remove reference to unused parallel gem
It *is* still used by rubocop, so this doesn't actually remove it from our install set. But it does clean up the Gemfile a bit!
2025-07-26 09:56:49 -07:00
d75b30ee7b Upgrade async gems
Just because I'm poking at archiving again, I'm noticing failures when trying to run the `rails swf_assets:manifests:load` job, something to do with an "unacquired resource" with the connection.

Maybe this is a bug that an update will fix? May as well try!
2025-07-26 09:55:26 -07:00
ba873e9e55 Upgrade to Ruby 3.4.5, Rails 8.0.2
Also improved the upgrade process a tiny bit, with some Ansible config simplifications.
2025-07-23 20:39:27 -07:00
234c866e28 Add links to ~lebron petpage 2025-06-27 17:32:16 -07:00
8eebc96b00 Remove now-unused HTTParty dependency
Oh nice, we removed the last call site! Goodbye!
2025-06-27 15:32:54 -07:00
a4dd680445 Use improved NC trade value text in item page 2025-06-27 15:30:36 -07:00
10708de615 Migrate from Owls NC values to Lebron
Owls has retired, and a new team have taken up the mantle! Exciting!
2025-06-27 15:26:38 -07:00
0e57a76ce6 Fix NC style series sort order in search dropdown
Oops, I didn't realize that the MySQL function `SUBSTRING_INDEX` always
returns the full string if the split delimiter isn't found.

This meant that, for series names like "Regal", we read the main name as
"Regal" (correct) and the variant name as "Regal" (incorrect).

This caused sort order to be incorrect for some series, e.g.,
- Prismatic Dawn: Regal
- Prismatic Dusk: Regal
- Prismatic Mirage: Regal
- Regal

whereas the main series name is meant to be first, and *does* come first
in cases like "Festive" where the main name sorts before any of the
variant names!

In this change, we update the variant name definition to return an empty
string. That way, when there's no variant name and it's just the main
series, that one sorts to the top of the series variants.
2025-06-22 12:37:28 -07:00
14be40a292 Fix NC Mall Styling Studio import
They made a small change to the API call! Fixed now!

The other NC Mall syncing stuff to get current NC cost is broken, but
that seems like a MUCH bigger change, so I won't bother just yet.
2025-06-22 12:24:27 -07:00
1cfb5129fa Hide shadowbanned users from trade lists for most viewers
Users will still see their own trades in the list and in the counts,
and support staff will still see them too!
2025-06-22 11:35:27 -07:00
903d6a8a19 Disallow email addresses in Neopets usernames
People are evading the filtering in the description and they know it!
Boooo!
2025-06-22 11:16:26 -07:00
0e32eb5d8f Hide duplicate timestamps on item trades page
Just a small visual cleanup because I happened to click on item trades
today! We don't need to repeat "This Week" a million times. Just output
it for the first row, then hide it for the following. (We still include
it in screen reader output for semantic clarity; this is just a visual
cleanup.)
2025-06-22 10:43:48 -07:00
99290235f5 Add bin/deploy:rollback to go back to a previous version
While I'm messing with production builds, I keep having to rollback a
bunch, so now we finally add tooling for it, lol
2025-04-27 13:05:44 -07:00
00ec7002cb Upgrade esbuild to 0.25.3
Both just a good idea, but also I'm debugging an issue with serving the
production build of React, and I'm wondering if it's an esbuild version
issue.
2025-04-27 12:23:12 -07:00
bdd4356894 Add cached gems for x86_64
This is part of what happens when you develop on multiple devices with
different chipsets! 😅
2025-04-27 12:02:46 -07:00
a72d043659 Remove Sentry from wardrobe JS
I haven't opened Sentry in a long time, and it's clogging up my Network
logs while debugging. Let's delete some telemetry!
2025-04-27 12:02:20 -07:00
735ca6c07b Upgrade to Rails 8.0.2 2025-03-29 14:45:51 -07:00
38bad12778 Fix item animations for asset URLs that contain unescaped spaces
Before this change, the "Ornamental Lake with Goldies" item would fail
to preview on the item page: the iframe for the animation layer would
display an error page.

The error was:

```
Invalid Content Security Policy script-src: "https://images.neopets.com/cp/items/data/000/000/497/497366_deca9f2827/497366_HTML5 Canvas.js". Directive values must not contain whitespace or semicolons. Please use multiple arguments or other directive methods instead. (ActionDispatch::ContentSecurityPolicy::InvalidDirectiveError)
```

This is because the URL that Neopets sends us for this JS file contains
an unescaped space character. This isn't usually an issue for e.g.
loading a URL in the browser, but it's *not* valid syntax for inclusion
in a Content Security Policy.

In this change, we update our CSP code to parse URLs into
`Addressable::URI` objects, which enables us to call the `normalize!`
method, which fixes oddities like that.

The URL now correctly appears in the CSP as
`https://images.neopets.com/cp/items/data/000/000/497/497366_deca9f2827/497366_HTML5%20Canvas.js`.
2025-03-29 14:45:41 -07:00
c48b2b14aa Add workarounds for new Neopets.com security rules
Neopets.com recently added some new security rules that, if not
satisfied, cause the request to return 403 Forbidden.

We figured these out through trial and error, and added them to the
`DTIRequests` library, so they would apply to all requests we make.

We also updated our AMFPHP library to use `DTIRequests` as well, as an
easy way to get the same security rules to apply to those requests.

This change was motivated by pet loading being down for the past day or
so, because all pet loading requests were returning 403 Forbidden! Now,
we've fixed it, hooray!
2025-03-29 14:14:46 -07:00
475c4eb8dd Upgrade to Ruby 3.3.7 2025-03-29 13:12:35 -07:00
8ba094a0be Add Support form for users, with shadowban option 2025-02-16 09:32:52 -08:00
2c2ba1fc67 Oops, fix visual bug for items page contact link icons 2025-02-16 08:55:57 -08:00
97ffffb67a Add configurable full name field to alt styles
Sigh, the "Valentine Plushie" series is messing with me again! It
doesn't follow the previously established pattern of the names being
"<series> <color> <species>", because in this case the base color is
considered "Valentine".

Okay, well! In this change we add `full_name` as an explicit database
field, and set the previous full name value as a fallback. (We also
extract the generic fallback logic into `ApplicationRecord`, to help us
express it more concisely.)

We also tweak `adjective_name` to be able to shorten custom `full_name`
values, too. That way, in the outfit editor, the Styles options show
correct values like "Cherub Plushie" for the "Cherub Plushie Acara".

I also make some changes in the outfit editor to better accommodate the
longer series names, to try to better handle long words but also to
just only use the first word of the series main name anyway. (Currently,
all series main names are one word, except "Valentine Plushie" becomes
"Valentine".)
2025-02-15 21:52:47 -08:00
667f562a88 Oh right, use the series name in the message 2025-01-22 16:46:36 -08:00
a4c3c31279 Add hint to outfit editor when searching for "token", "nostalgic", etc
I don't know how reliably people actually know that we support NC
Styles, because the token items aren't searchable.

In this change, we add a little message to teach people about this
feature, if they search for words that match known styles, or the
colloquial word "token" (even though style token items aren't actually
called that on-site).
2025-01-21 15:07:17 -08:00
b3f635c96c Fix bug parsing discount time when importing from NC Mall
Previously, we took the incoming date as just an integer, which was
raising a database error when we attempted to save it to a timestamp
field. Now, we correctly parse it into a timestamp.

I imagine we just haven't run the import manually while there's a real
discount in the records before? Weird!
2025-01-18 10:49:04 -08:00
86a1875d6d Tweak gem grouping for test libraries
Idk a clear and concise way to group all these together, *and* include
`rspec-rails` in both development and test as the install instructions
recommend, but omit `webmock` from development.

Not that it matters a lot, I just want to be minimal about the gems we
include, for the sake of clarity.

This formulation is a bit verbose, but I think it's maximally clear and
self-consistent, and I appreciate that. I might change my mind later
though?

Anyway, I mostly just noticed this because of the redundancy where
`webmock`'s `group: :test` I think doesn't do anything? Shrug
2025-01-12 19:21:55 -08:00
bf1c8f71fe Oops, fix external HTTP requests by updating async-http gem
Huh okay, looks like maybe the `protocol-http` or `protocol-http2` gem
made non-backwards-compatible changes that broke `async-http`. But
moving to the very latest `async-http` seems to fix it. Okay!
2025-01-12 19:11:24 -08:00
39fe53c51f Run bundle:update, and work around bug in latest protocol-rack
It's been a while, time to update all our minor/patch versions!

When I first ran this, the dev server stopped working entirely, saying:

```
NoMethodError: undefined method `ip_address' for an instance of Socket
```

I traced this back to what seems to be a bug introduced in
`protocol-rack` version `0.11.0`, so I modified the Gemfile to hold us
back from that version in particular. After that, everything is looking
good!
2025-01-12 13:07:14 -08:00
8eb3f73deb Run rails app:update to update config files 2025-01-12 12:36:18 -08:00
eba5f04ec0 Upgrade to Rails 8.0.1 2025-01-12 12:15:23 -08:00
e09296ef51 Fix outfit editor bug where opening style picker increases page height 2025-01-12 12:10:47 -08:00
b6e3079599 Use shorter style name in outfit editor's pose picker label
Now that some of these series names are very long (like "Prismatic
Cocoa: Festive"), they can throw off the layout. Let's just use the
shorter one, it's clear enough!
2025-01-12 12:02:52 -08:00
a385a5b962 Better ordering for NC Styles in the outfit editor
Previously, when opening the pose picker and looking at Styles, the
Cybunny options were sorted like this:

- Default
- Celebratory 25th Anniversary
- Festive Christmas
- Nostalgic Baby
- Nostalgic Blue
- Nostalgic Christmas
- Nostalgic Darigan
- Nostalgic Faerie
- Nostalgic Grey
- Nostalgic Maraquan
- Nostalgic Mutant
- Nostalgic Plushie
- Nostalgic Robot
- Nostalgic Royalboy
- Nostalgic Royalgirl
- Nostalgic Snow
- Nostalgic Tyrannian
- Prismatic Cocoa: Festive Christmas
- Prismatic Cocoa: Nostalgic Christmas
- Prismatic Tinsel: Festive Christmas
- Prismatic Tinsel: Nostalgic Christmas
- Spooky Halloween

Now, they're sorted like this:

- Default
- Celebratory 25th Anniversary
- Nostalgic Baby
- Nostalgic Blue
- Festive Christmas
- Prismatic Cocoa: Festive Christmas
- Prismatic Tinsel: Festive Christmas
- Nostalgic Christmas
- Prismatic Cocoa: Nostalgic Christmas
- Prismatic Tinsel: Nostalgic Christmas
- Nostalgic Darigan
- Nostalgic Faerie
- Nostalgic Grey
- Spooky Halloween
- Nostalgic Maraquan
- Nostalgic Mutant
- Nostalgic Plushie
- Nostalgic Robot
- Nostalgic Royalboy
- Nostalgic Royalgirl
- Nostalgic Snow
- Nostalgic Tyrannian

Note especially the Christmas case, which is all together now! I think
it's also more in line with people's expectations for Halloween to be
alphabetically among the rest, instead of being at the bottom for being
"Spooky".

There's enough styles now that I'm starting to wonder if there's other
UI affordances worth having here, like e.g. only showing (or at least
prioritizing) styles that match the chosen color? But I don't want to
mislead people about compatibility, either.
2025-01-12 11:58:37 -08:00
6ced72e10a Better grouping for alt style series names in the filter dropdown 2025-01-08 15:51:28 -08:00
eff7f75a3a Oops, fix crash in Shopping List for PB items
Huh, I guess I refactored the URL handling at some point and messed up
this call site? Ok whatever!
2025-01-06 00:25:36 -08:00
39e6872f59 Add some better comments and organization to swf_assets/show.js
Mostly headers, a comment that was out of date, and a function I moved
to be in a slightly more sensible spot!
2025-01-04 13:47:23 -08:00
3940513244 Oops, fix silly mistake when combining zones by label on the item page
Oh, right, silly: my previous version of this change still grouped by
zone, then mapped the zones to their labels. This didn't *merge* the
lists of appearances for zones that share the same label; just one of
the zones would win, and the others would disappear.

In this change, I just go upstream and actually group them by label in
the first place, instead of grouping by zone then trying to merge and
transform them.
2025-01-02 19:39:53 -08:00
28cdef29d0 Combine zones with the same label on the item page
For example, the "Red Knitted Beanie with Wig" occupies two different
"Hat" zones: one for behind the head, and one for in front. It's not
useful to split them up!
2025-01-02 19:26:11 -08:00
5be35591c2 Use CSS instead of server requests for image format in pet styles form
Instead of offering a form to request a different format, we just
render both in the HTML, and use CSS to swap between the two. Love to
see the `:has` filter come through for us!
2025-01-02 19:04:48 -08:00
7f62417294 Fix bug sorting pet styles by creation date
Before this change, the sort order when searching for
"Prismatic Pine: Nostalgic" showed:

- [Added Dec 18, 2024] Prismatic Pine: Nostalgic Christmas Flotsam
- [Added Dec 19, 2024] Prismatic Pine: Nostalgic Christmas Gelert
- [Added Dec 18, 2024] Prismatic Pine: Nostalgic Christmas Bruce
- [Added Dec 17, 2024] Prismatic Pine: Nostalgic Christmas Scorchio
- <more>

This is because the Gelert was created at 11:37 NST on Dec 19, whereas
the Flotsam was created at 18:11 NST on Dec 18—but in UTC, which is how
timestamps are stored in the database, these are both Dec 19, so the
Flotsam was sorting first alphabetically.

In this change, we do a hacky transform from UTC to NST-ish. I didn't
want to set up the deploy process to pull named time zones into MySQL,
and then have this as a potential gotcha for the dev environment
later—so instead, I pretend `-08:00` is a good-enough specification of
NST.

This will sometimes create slightly incorrect sort ordering when it
*is* Daylight Savings, and a record was created around midnight. I'm
okay with that!
2024-12-29 16:11:00 -08:00
fe6d42ef67 Remove "<New?>" from pet style search filters
When there's an unlabeled style, previously we'd include the placeholder
value "<New?>" in the search dropdown, even though we don't actually
support searching by it.

Now, we don't! I did this in part by just refactoring how we look this
stuff up, with queries that don't load *all* alt styles into memory,
which will help perf a bit as more of them are released.
2024-12-29 15:52:50 -08:00
b8772c3aad Add no results message for alt style searches 2024-12-29 15:47:12 -08:00
8502b780c2 Add FORCE=1 flag to override series names in Styling Studio auto-import
I ran a bad version of this job yesterday, and set a lot of the new
styles to an incorrect "Prismatic" series name. This will help me fix
them!

There's still styles to manually fix, where TNT decided not to put the
full series name in the item name. (Presumably some of the names were
too long? Or maybe they just forgot?) But this is a better starting
point!
2024-12-29 15:39:52 -08:00
2f090f3924 Oops, improve series name parsing in Styling Studio auto-importer
Ahh right, that's part of why I skipped Prismatics: it's no longer true
that the first word of the style is its series name.

In this change, I try to parse out everything before the pet name part
of the style name, and default to skipping it if we can't quite get it
right.
2024-12-29 15:26:26 -08:00
ab572b6576 Fix magic magnifier positioning in Firefox
Oh oops, Firefox is a bit stricter about interpreting custom elements
as inline elements by default instead of block elements. This messes up
the positioning relative to the container. Fixed!
2024-12-28 16:11:38 -08:00
019484b6dd Oops, fix showing the magic magnifier in Firefox
Oh, guess Firefox doesn't support this CSS container query feature yet!
Use a more compatible technique instead.
2024-12-28 16:08:28 -08:00
34bf27069b Oops, fix silly routing mistake where I set path twice for same route
Ruby 3.3.6 has a warning for this, neat! I apparently didn't notice the
`path` option already there at first, and just added a new one.

This change shouldn't affect behavior, it just is clearer and removes a
warning!
2024-12-28 15:58:41 -08:00
84dec2d82e Tweak output for Styling Studio auto-importer
A style not being modeled yet is not a big deal, whereas some of those
other warnings actually require manual intervention. I want to make the
list easier to scan for the warn icons!
2024-12-28 15:53:24 -08:00