Comments (5)
To be fair, the whole ActivityPub fetching logic with the database mapping needs a major cleanup. It's in an abysmal state at the moment.
Maybe that cleanup can also add better testing to it finally.
from kitsune.
I think the ideal handling of threads is to use an asynchronous job worker like Mastodon's ThreadResolveWorker
instead of occupying a task until the thread is fully resolved, iterative or not.
Maybe this would require the database schema to be aware of replies whose in_reply_to_id
is yet to be resolved.
from kitsune.
Yeah, good point. But even if it's run in a background task, I'd personally prefer an iterative operation since it won't exhaust the stack space because of function calls
from kitsune.
Maybe this would require the database schema to be aware of replies whose in_reply_to_id is yet to be resolved
Not sure if we need that. We could just set that to NULL
if we haven't resolved that and then just enqueue a new job to resolve the thread on initial fetch
from kitsune.
Yeah, good point. But even if it's run in a background task, I'd personally prefer an iterative operation since it won't exhaust the stack space because of function calls
I was assuming that the worker would only fetch a single post in a job and, well, recursively enqueue another job to the scheduler to fetch the reply until the thread is fully resolved, so that it won't exhaust the stack (and each job is reasonably short-lived). That's how Mastodon's worker is implemented IIUC.
We could just set that to
NULL
if we haven't resolved that and then just enqueue a new job to resolve the thread on initial fetch
Yes, I think we don't need this if we can hold a transaction over the whole thread resolution process, but otherwise, clients may observe a reply whose in_reply_to post haven't been resolved. Just making the in_reply_to_id
to NULL
in this case would make the client to recognise the post as a non-reply, which is not true.
Well, come to think of it, we don't keep a transaction over the whole process_new_object
function today either, so this problem might not be inherent to the said worker approach anyway.
from kitsune.
Related Issues (20)
- RUSTSEC-2023-0081: safemem is unmaintained HOT 4
- Switch to `sonic-rs`
- RUSTSEC-2020-0168: mach is unmaintained HOT 2
- Revamp internal error representation
- Remove Redis dependence HOT 2
- Cannot find module './locales/en-cyberpunk.ftl'
- RUSTSEC-2024-0320: yaml-rust is unmaintained. HOT 4
- Add extensive coverage for `mrf-tool` HOT 1
- Store compiled WASM modules for the MRF inside a cache HOT 1
- Replace `std::sync::Arc` with `triomphe::Arc` where possible
- Replace `redis-rs` with `fred`
- Iroh & Willow interop HOT 1
- `mimalloc` fails to compile with some GCC versions HOT 1
- [DISCUSSION] Do we need OpenAPI docs for the Mastodon API?
- Cannot display the following and followed / "Error: Unexpected token ..." HOT 2
- Switch to `hickory-resolver` for DNS queries
- SOCKS5/HTTP(S) proxy support
- [Tracking issue] Tor/I2P federation
- RUSTSEC-2024-0370: proc-macro-error is unmaintained HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kitsune.