Commit graph

7 commits

Author SHA1 Message Date
Kopper
94328a3eef [backend] Use a stack instead of queue when backfilling
This makes each reply chain load completely before loading the next
chain, instead of the current behavior that loads all replies of one
depth before loading the next "layer".

This won't make much of a difference *now*, but should result in more
intuitive behavior when live updating of newly loaded replies gets
implemented.
2024-11-06 20:02:29 +01:00
Kopper
90f1e30ef2 [backend] Fix reply backfill limiting 2024-10-26 07:24:39 +02:00
kopper
27ac36d747
[backend] Add config option to sign reply backfills with requesting user
Signed-off-by: Laura Hausmann <laura@hausmann.dev>
2024-10-24 21:18:58 +02:00
kopper
7173373330
[backend/federation] Improved reply backfill
Instead of backfilling every note we come across that has a reply
collection, only schedule a backfill job if someone wants to see the
replies (on GET MastoAPI /context, or Iceshrimp API /descendants)

Reply backfilling is also done on a ThreadIdOrId basis as opposed to the
previous way of backfilling individual notes. This allows us finer
grained control over the recursion and frees up the job queue, alongside
allowing for easier implementation of context collection backfill in the
future (by mapping each context collection to a thread)

---

Currently, note threads are implicit based on the "threadId" column of a
note, which can be null (where it's the same as the note's "id")

This commit turns note threads into an actual entity, and as a part of
that, makes "threadId" non-nullable (by specifically setting it to "id"
for those cases)

This is done to attach extra metadata to the entire thread, currently
just the time of when it was last backfilled, but more may be added in
the future (the context collection associated with this thread, for example)

---

The data format for backfill jobs have backwards-incompatibly changed
since the introduction of the feature. We can drop all old jobs without
causing too much trouble as they will be re-scheduled on demand

---

Signed-off-by: Laura Hausmann <laura@hausmann.dev>
2024-10-24 21:18:57 +02:00
Kopper
48784690c1 [backend/federation] Do not queue backfill jobs that have reached their recursion limit 2024-09-18 18:27:14 +02:00
Kopper
d6a8282a18
[backend/federation] Try using the original collection object when possible 2024-09-15 01:49:42 +02:00
Kopper
024de937d0
[backend/federation] Backfill replies 2024-09-15 01:47:41 +02:00