-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: support for conversation_id #115
Conversation
@ri72miieop is attempting to deploy a commit to the theexgenesis' projects Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@ri72miieop you can run |
btw for long running materialized view refreshes it's best to do it concurrently - otherwise selects are prevented |
I also wouldn't put conversation_id in the main tweets table, I'd make a separate table, just bc it's something we're adding on |
I would also put all these functions in the private schema, the only reason to be in public is if we need to call them from the client side, as a user |
I'm also wondering if that materialized view is necessary. Do you have a specific purpose in mind for it? Might it be enough to have a regular view that computes just in time? |
* 'main' of https://github.com/ri72miieop/community-archive: fix: import formatteduser type script: check archives in storage but not db and vice versa refactor: user info, add user followers to featured profiles, likes to user dir feat: word occurrences pg fn Update archive_data.md Update archive_data.md style: format counts script: anon key download storage fix: don't require like.js fix: delete timeout migration doc: what data we use from archive fix: delete archive timeout
Added index on main_thread_view Refresh materialized view concurrently
…tions Change materilized view to calculate info for all threads for a function that does that same for a single conversation_id Create view tweets_w_conversation_id
Changes made:
It's compiling on my machine but it seems to be failing on Vercel? Not sure if that's because there's some manual process necessary or it is failing to compile, if there's any issue let me know. |
@ri72miieop Thanks for updating! Looping over individual tweets seems inefficient, have you considered starting from root tweets and processing them in layers? I asked Claude to draft a proposal. Haven't tested yet. |
testing the latest functions
|
This PR adds the field conversation_id to the tweets table. It has a value when the whole chain of replies up to the main tweet is found on the archive, otherwise it stays NULL.
When the user finishes the upload of the archive and the upload_stage is changed to 'complete' a new job with the key 'update_conversation_ids' is queued. This job calls a function which runs the update over all the tweets (this is needed to also update conversation_id of other users that have interacted with tweets from the one who uploaded, but there's some space for optimizations here) and refreshes the materialized view.
The materialized view 'main_thread_view' contains only the tweets in the main thread, so no replies from other users nor a continuation of a conversation between the user who wrote the thread and others.
related to #70