Reviving #299 proposal: generalized collection migration UI
Context:#
We need migration for atproto records on user's PDS (e.g. .feed.comment or future org.tangled.* records.) Supporting legacy records forever is unrealistic. We should at least cleanup most of legacy records. But we need active PDS session to perform migration.
Currently we already do some migrations on login, but it requires user action to logout and relogin.
Solution#
- schedule migrations for legacy records in appview DB
- on any active user session, when there are pending migrations, redirect to
/migrationpage - on
/migrationpage, show real-time migration progress - when migration is done, redirect back to original page
Something like this:
/migration?return_url=/tangled.org/core/issues
Tangled is migrating some legacy data from your [PDS].
You will be redirected back to [/tangled.org/core/issues] when migration completes.
[1/3] Add `RepoDid` field to repo-referencing records
Progress: 30% [=======> ]
So appview won't require relogin for migration, and users can know what's happening clearly. As this strategy doesn't require relogin, it is more strong, so we can expect legacy records to be migrated more quickly.
When sufficient amounts of records are migrated, we can deprecate backwards-compatibility layer from appview code.
One thing we should decide is behavior on migration failure.
There can be various reasons for a migration to fail:
Option 1#
Expect all migrations to succeed. Always redirect to
/migrationpage when there are pending migrations for that account. This won't let users to use tangled until the bug gets resolved.Option 2#
Track failed migrations. Don't redirect to
/migrationpage when previous attempt failed. We can just remove the old records from appview DB & restore them once migrating succeed.From user's perspective, option 1 is pretty tough experience, but if we go with option 2, we can easily have dangling failed migrations...