Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Thread more imports #187

Merged
merged 4 commits into from
Nov 30, 2023
Merged

Conversation

dakkar
Copy link
Contributor

@dakkar dakkar commented Nov 30, 2023

As I wrote in #177:

recreateChain converts a list of notes into a forest of notes, using notes that are not replies as roots, and replies as child nodes, recursively.

Previously, notes that are replies to notes not included in the export, and their children, were never put in the forest, and therefore wheren't imported.

This can be fine when importing from Twitter, or *key, since we can't really link a note to a tweet.

It's less fine when importing from Mastodon & Pleroma, because in those cases we can link to the remote note that the user was replying to.

This commit makes recreateChain optionally return "orphaned" note trees, and uses that feature when importing from Mastodon (tested) and Pleroma (should work fine).

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

gceccarelli-vt and others added 4 commits November 30, 2023 13:26
`recreateChain` converts a list of notes into a forest of notes, using
notes that are not replies as roots, and replies as child nodes,
recursively.

Previously, notes that are replies to notes not included in the
export, and their children, were never put in the forest, and
therefore wheren't imported.

This can be fine when importing from Twitter, since we can't really
link a note to a tweet.

And, for the moment, it's acceptable when importing from *key, because
the export doesn't contain the instance URL, so we can't resolve ids
to remote notes.

It's less fine when importing from Mastodon / Pleroma / Akkoma,
because in those cases we _can_ link to the remote note that the user
was replying to.

This commit makes `recreateChain` optionally return "orphaned" note
trees, so in the (near) future we can use it to properly thread
imported notes from those services.
the id / replyId are not at the top level, so now `recreateChain`
takes a list of keys to walk, not just a single key
I have _not_ tested this, but it should work fine, those exports are
the same shape as Mastodon's
@Mar0xy Mar0xy merged commit acfb245 into transfem-org:develop Nov 30, 2023
9 checks passed
@Mar0xy Mar0xy mentioned this pull request Nov 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants