Skip to content

Allow fetching a speaker with their talks as JSON #821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

calebhearth
Copy link
Contributor

No description provided.

Copy link
Member

@adrienpoly adrienpoly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea to improve our json api
I do have a few concern about the performance with the current implementation

also if you can try on a user with lots of talks like Marco or Aaron, remove the cache and ensure they are no n+1 (I think they are now)

you might want to remove some of the present? https://www.speedshop.co/2019/01/10/three-activerecord-mistakes.html

Comment on lines +34 to +37
if speaker.user.present?
json.bio speaker.user.bio
json.avatar_url speaker.user.avatar_url
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got a 500 here I think those attributes should come directly from the speaker model not the user

Comment on lines +46 to +49
json.transcript do
json.raw talk.raw_transcript
json.enhanced talk.enhanced_transcript
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those can be pretty large fields. before this PR it was only used for the Talks#show view.
Now the problem is that for a speaker with lots of Talk (hello Marco/Aaron) it generates a huge json.

I think we should remove the transcript when we fetch a collection of talks

@calebhearth
Copy link
Contributor Author

Oh whoops I hadn't intended to open a PR yet. Thanks for the input! I'll circle back on this and address that.

@marcoroth marcoroth force-pushed the main branch 2 times, most recently from d35f39a to ec30df0 Compare August 9, 2025 18:51
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