Current Problem: Moving a document tears it down
At the moment, when you a Phriction document (that is, "Rename URL", for friends), the document is not really moved, and these things happen instead:
- if the destination never existed:
- a new dummy copy is created with a single new version with the current content (!)
- if the destination existed and was deleted:
- a new single revision is appended in the history of the deleted document (!)
In all cases, all the following unexpected things happen after moving, at least:
- T15822: When a phriction page is moved, history should follow the page move
- T15575: Moving a Phriction page does not move its Tags
- the destination page has not past subscribers
- the destination page has not past awarded tokens (SUPER IMPORTANT BABY TEQUILAS LOL)
- the destination page has not past flags
- the destination page has not past comments
- the destination page has different PHID
Basically, you "Move" a page... and instead you disintegrate it 💣 from its ashes a new wild page appears (with just your title, and your content) like a strange delicate baby phoenix lol
Exploration of the Current Status
At the moment a PhrictionDocument seems quite sticky on its title. Maybe they should be called "Title placeholders" for friends.
So, at the moment the Move feature works by making sure that the source PhrictionDocument is mostly untouched and by making sure that there is a new document placeholder:
And by adding a new version:
So that's why the new document is really something completely separated at the moment.
So, the current business logic that seems to have more limitations than features is:
Considering New Approaches
There is some natural desire for this:
Non-Proposal
If we don't want to afford new approaches, we can just make sure to inherit past stuff and edges (I say "inherit", to intentionally stay a bit vague between "copy" and "move").
So at least on the new copy we should
- move versions
- copy? tags
- copy? subscribers
- copy? awarded tokens
- copy? flags
- move? comments
- ...
But this is a lot of work and more delicate than just changing the title.
Proposal
Current | After ✨ | |
---|---|---|
Target document | The target page is a new dummy one from scratch | The target page is the source page \o/ |
Source document | Add version with ChangeType = 3 MOVE_AWAY | The source page is a new dummy one from scratch with add version with ChangeType = 3 MOVE_AWAY |
Possible pitfalls:
- What we should do on the deleted target page?
- Possible solution: we can just apply a move to that too. Appending (2) in its title. So their versions are NOT meld with the old page.
- feel free to share comments to discuss possible pitfalls and add here 🌈
Quality Assurance
Whatever the solution, this is the minimal test plan for any solutions:
- all the points under "Current Problem" are all solved
- already existing "move" transactions must still work
- create a page "source", create a page "destination", move "source" to "destination": it still should say "You can not move this document there, because it would overwrite an existing document which is already at that location. Move or delete the existing document first."
- create a page "source", create a page "destination", delete "destination", move "source" to "destination": it still works like before (unclear what should happen to the target destination, since it has history and metadata and comments, maybe should be moved elsewhere)