Commit graph

74 commits

Author SHA1 Message Date
73af9d4d77 Start migrating off globalize gem for zones
Like in 0dca538, this is preliminary work for being able to drop the
`zone_translations` table! We're copying the field over first, to be
able to migrate DTI 2020 safely before dropping anything.
2024-01-23 05:43:00 -08:00
413d2eed91 Improve species/color name migration performance & correctness
Oh right, this should only run in the up direction! And also we can get
a lot faster by preloading the translations.
2024-01-23 05:30:42 -08:00
0dca538b0a Start migrating off globalize gem for species/color names
Non-English languages haven't been supported on Neopets for a while, so
I'd like to remove this extra cross-cutting complexity, especially
since it's now inconsistent with the real site anyway!

The main motivation is that I'd like to do this for items too, because
I have a hunch that all the complexity of `globalize` to read
`item.name` is part of what's making large user lists so slow to
render: lots of little objects getting created down the stack, and
needing to be garbage-collected later.

I'm not sure that's why! But I figure removing this complexity is a
simplicity win anyway, so let's do it!

Note that this doesn't *finish* the migration, it just starts it! The
`Species::Translation` and `Color::Translation` models still exist, and
still have their data, and not all references to them are scrubbed yet.
I especially don't want to delete the backing tables until both DTI and
DTI 2020 are ready for it!

So this change will someday be paired with another change to actually
drop the tables - after backing up the data for future records just in
case, of course!
2024-01-23 05:10:43 -08:00
470c805880 Save last trade activity time onto User
In impress-2020, we do a big slow query to figure out which users have
been active in trades recently. Now, we cache that timestamp on the
User model.

This won't have any immediate effect; it's to clear the way for Classic
DTI to receive the better trade ratios feature people like from 2020.

I also added some unit testing infra because I finally wanted it! for
all the ways you can trigger this timestamp lol

Note too that this is a bit of an unusually complex migration, but my
hope is that the batching and query structure and such helps it run
surprisingly fast! 🤞
2024-01-19 00:00:46 -08:00
c725a11920 Remove unused NC Mall spider code & fields
We haven't used the mall spider in this app in forever (I guess we even
deleted the code at some point?), but there was some vestigial stuff
left. Goodbye!
2023-11-11 15:45:38 -08:00
644a6acc72 Remove old Image Mode stuff
There was a static page explaining it, which we no longer link to; and
there was an unused field in the User model for who was a beta tester
for it. Goodbye!
2023-11-11 15:21:49 -08:00
dc22a458bf Move manifest backfill to swf_assets:manifests task
Okay, I've simplified the migration to *just* add the column, and
instead added a task to find assets without manifest URLs and backfill
them.

Performance is a lot better now, using the `async-http` library, which
as I understand it supports both persistent connections when invoked
like this, and maybe also HTTP/2 multiplexing?? (Though I'm not
actually sure images.neopets.com does lol)

I'm not sure about the number of concurrent tasks I picked here, 100
seems okay for an internet thing and for such small requests, but I
worry that the CDN is gonna get annoyed or something. Well, we'll see!
This task is very resumable if it turns out we get frozen out or
something.
2023-11-10 16:52:50 -08:00
96998643b5 Add manifest_url to swf_assets table
Ok so, impress-2020 guesses the manifest URL every time based on common
URL patterns. But the right way to do this is to read it from the
modeling data! But also, we don't have a great way to get the modeling
data directly. (Though as I write this, I guess we do have that
auto-modeling trick we use in the DTI 2020 codebase, I wonder if that
could work for this too?)

So anyway, in this change, we update the modeling code to save the
manifest URL, and also the migration includes a big block that attempts
to run impress-2020's manifest-guessing logic for every asset and save
the result!

It's uhh. Not fast. It runs at about 1 asset per second (a lot of these
aren't cache hits), and sometimes stalls out. And we have >600k assets,
so the estimated wall time is uhh. Seven days?

I think there's something we could do here around like, concurrent
execution? Though tbqh with the nature of the slowness being seemingly
about hitting the slow underlying images.neopets.com server, I don't
actually have a lot of faith that concurrency would actually be faster?

I also think it could be sensible to like… extract this from the
migration, and run it as a script to infer missing manifest URLs. That
would be easier to run in chunks and resume if something goes wrong.
Cuz like, I think my reasoning here was that backfilling this data was
part of the migration process… but the thing is, this migration can't
reliably get a manifest for everything (both cuz it depends on an
external service and cuz not everything has one), so it's a perfectly
valid migration to just leave the column as null for all the rows to
start, and fill this in later. I wish I'd written it like that!

But anyway, I'm just running this for now, and taking a break for the
night. Maybe later I'll come around and extract this into a separate
task to just try this on all assets missing manifests instead!
2023-11-09 21:42:51 -08:00
b8a8cb9b20 Stop orphaning hangers when deleting lists
Idk if this used to be different or what, but it looks like the current
behavior is: if you delete a closet list, it'll leave the hangers
present, but Classic DTI would not show them anywhere; but Impress 2020
(until recently) would crash about it.

Now, we use `dependent: :destroy` to delete the hangers when you delete
the list (which I think makes sense, and is different than what I
decided in the past but that's ok, and is what the current behavior
*looks* like to people!), and we add a migration that deletes orphaned
hangers.

The migration also outputs the deleted hangers as JSON, for us to hold
onto in case we made a mistake! I'm also backing up the database in
advance of running this migration, just in case we gotta roll back HARD!
2023-10-24 15:35:21 -07:00
e79428fa28 Add Remember Me to login
This requires a migration, our first migration against the openneo_id database from this app! Fun!
2023-10-23 19:05:08 -07:00
b2a027fbbf Oops, should've used migration version 4.2
Oh I didn't realize the lowest version Rails had for this is 4.2. I wish running `rake db:migrate` checked this, but I'm running into it on another branch when I try to create a *new* migration which for some reason leads it to inspect the old migrations and notice the issue. Weird!
2023-10-23 19:05:08 -07:00
60284a87cc Update schema.rb format
Running a no-op `rake db:migrate` happened to reformat this file to be more modern. Ok neat!
2023-10-23 19:05:08 -07:00
fcf3292448 Add Rails version to old migrations
I'm not sure it's literally true that they were all built against Rails 3.2, but that's what it was at before we upgraded, and like. that's probably fine
2023-10-23 19:05:08 -07:00
75185de957 Create a User when we create an AuthUser
We also update seeds.rb to be up to date! This should make it possible to log in as test/test123 from a fresh database.
2023-10-23 19:05:07 -07:00
1d5af835a5 Add AuthUser model, connecting to openneo_id db
No user-facing functionality here yet, just configuring the database connection to work with openneo_id records.

This is a first step in integrating Devise stuff into this app instead of connecting with a weird second app.

My basic testing for this was to temporarily connect to production `openneo_id`, and see `AuthUser.first` correctly return a user!
2023-10-23 19:05:07 -07:00
7e922503b5 Upgrade to Rails 7.0.6
Whew! Seems like a pretty clean one? Ran `rails app:upgrade` and stuff, and made some corrections to keyword arguments for `translate` calls. There might be more such problems elsewhere? But that's hard to search for, and we'll have to see.
2023-10-23 19:05:07 -07:00
Matchu
38f3c9894c Delete WardrobeTip model
lmao I have zero recollection of this, I've been generally trying to avoid too-far-off-the-path cleanup, but this one just seems silly, goodbye
2023-10-23 19:05:05 -07:00
Matchu
5da4006053 Set up development database in Vagrant
Just a lil bit of extra provisioning and config! We also added some more to the `seeds.rb` task, to set up records that the app expects to exist.
2023-10-23 19:05:04 -07:00
Matchu
8aa4aa6e30 Drop NewsPosts model
We never ended up really using this lol, and it has an attr_accessible I want to be rid of so let's just fully trash it while we're at it!
2023-10-23 19:05:04 -07:00
Matt Dunn-Rankin
c7d60e3e41 Add db field to override special color
Okay, fine, finally making this controllable from the db without requiring a deploy :P Setting this new field will cause `item.special_color` to return the corresponding color. This mainly affects what we show on the item page, and what colors we request for modeling on the homepage.
2018-05-09 14:10:20 -07:00
Matt Dunn-Rankin
f5fb8711fc improved donation campaign nav 2017-01-05 13:06:50 -08:00
Matchu
b5442d0f3f news posts read from the database, with a campaign-supplement classname option :) 2015-09-26 20:37:03 -07:00
Matchu
2ca784c3a2 thank-you message automatically deploys on campaign success 2015-09-22 22:40:51 -07:00
d8038f2fbf prefer scraped rainbow pool images over pet images 2015-09-05 18:48:41 +00:00
Matchu
5d2c226357 yum, new campaigns 2015-08-05 19:26:12 -04:00
0e6f823154 toggle whether a donation campaign is advertised 2015-02-25 13:49:18 -06:00
8e22c271a4 track campaign progress 2014-09-11 17:40:37 -05:00
f11f6374da donation mailer 2014-09-10 14:32:54 -05:00
90b45dcecd edit featured outfits on donation page 2014-09-09 23:16:02 -05:00
59d5e99312 donation show form and basic name updating 2014-09-09 22:04:17 -05:00
595b1c2fc5 charge and record donations 2014-09-09 21:11:55 -05:00
8fc156833f basic tip functionality 2014-04-02 23:00:50 -05:00
f9fa3eb596 prank color artist credit 2014-03-31 21:05:28 -05:00
49a901abfb prank color migration 2014-03-27 22:28:48 -05:00
b2fca6b6c1 closet hangers index uses neopets connections dropdown 2014-01-18 22:50:14 -06:00
72b174c9b3 store all neopets usernames for logged-in users, but breaks closet_hangers#index 2014-01-18 21:55:01 -06:00
8bd7ad5a1e support manually uploaded swf asset images - not the actual uploading, but block them from being reconverted 2013-10-16 15:50:48 -05:00
bf528b06d2 label pet states as glitched, send to bottom of emotion order 2013-04-27 10:21:51 -05:00
a39110884d cut down on pets#load queries 2013-01-28 02:10:25 -06:00
26ac3782ec move zones to database 2013-01-24 18:26:00 -06:00
ce4e2fd53c move species to database 2013-01-24 18:25:59 -06:00
965465ca51 move species to database 2013-01-24 18:25:59 -06:00
d79c225c1e apply globalize3 to items 2013-01-24 18:24:34 -06:00
775ef7fa51 finally fix encased in ice - woo! 2012-10-05 20:56:52 -05:00
374c7e6147 Sharing now fully supports saved outfits, not just shared ones 2012-07-26 23:47:22 -04:00
cf2546d832 basic image thumbnails 2012-07-16 16:47:28 -04:00
220aca9311 outfit thumbnails initial commit 2012-07-16 16:45:26 -04:00
c2c6a800f2 track pet state gender/mood 2012-05-23 20:00:38 -04:00
6bf926eb3b major SQL optimization. how did we get away with so few indexes?! 2012-03-21 18:25:30 -05:00
696b2aedaf give SWFs real, unique ID numbers
Lots of scary bugs were being caused by the fact that the possibly-duplicate Neopets ID
was being treated as an SWF's real primary key, meaning that a save meant for object swf
number 123 could be saved to biology swf number 123. Which is awful.

This update gives SWFs their own unique internal ID numbers. All external lookups still use
the remote ID and the type, meaning that the client side remains totally unchanged (phew).
However, all database relationships with SWFs use the new ID numbers, making everything
cleaner. Yay.

There are probably a few places where it would be appropriate to optimize certain lookups
that still depend on remote ID and type. Whatever. Today's goal was to remove crazy
glitches that have been floating around like mad. And I think that goal has been met.
2012-01-12 17:17:59 -06:00