Skip to content

Conversation

@stereosteve
Copy link
Contributor

@stereosteve stereosteve commented Apr 9, 2025

Changes

  • Adds FullUsersKeyed, FullTracksKeyed, FullPlaylistsKeyed. Since we often need those things keyed by ID.
  • adds a app.resolveUserHandleToId function. Since we have several routes that support both handle and ID, they can be the same and the handle variant just needs to resolve ID first. We can add an in memory cache for handle resolutions (we do this in mediorum)
  • reposts endpoint mostly matches v1 api.

Feels

This PR code is all in one func instead of two... but compare it to this very similar elemental code:

The typescript version also does date based cursor pagination... and postgres.js makes it easy enough to do arbitrary sort stuff, since it's just tagged templates at end of day.

Seems pretty slick by comparison... Not saying we go back... but ya know.

@stereosteve
Copy link
Contributor Author

Some additional changes:

  • standarize error response format
  • use middleware to resolve myId / userId / handle. Can de-dupe error handling for invalid inputs, and makes it easy to re-use handlers for either userId or handle.
  • playlists get followee actions.

The c.Locals stuff can be a source of errors... we might eventually want to switch from a series of scalars to a single struct that contains all the locals.

@stereosteve stereosteve merged commit 262af35 into main Apr 9, 2025
2 checks passed
@stereosteve stereosteve deleted the v1_user_handle_reposts branch April 14, 2025 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants