ENB: paste-retaining-clones has always beeen broken & my plans to fix it

23 views
Skip to first unread message

Edward K. Ream

unread,
Jul 29, 2023, 5:01:18 AM7/29/23
to leo-editor

Warning: Please consider paste-retaining-clones unreliable until further notice. Leo's new structure tests have shown that paste-retaining-clones has always been buggy!


This Engineering Notebook discusses the bug and my plans for fixing it.


Problems with paste-retaining-clones


The paste-retaining-clones logic calls fc.linkChildrenToParents as a last-minute hack. Alas, the versions in both the master and devel branches are buggy. No quick fix seems possible.


Félix points out that paste-retaining-clones has never replaced existing body text with pasted body text. In other words, the command has never enforced the "pasted nodes rule" policy. Félix and I have discussed various strategies without a clear conclusion.


Remediation Plan


Step 1: Warn Leonistas about long-standing problems with paste-retaining clones.


That's what this ENB does :-)


Step 2: Enable automatic link repair in c.checkVnodeLinks and merge the changes into devel.


This item is urgent. I'll create a new PR for this item and merge it into devel and PR #3467 asap. At that point, devel will be approximately as reliable as it has ever been :-)


Step 3: Continue work on PR #3467: fix paste-retaining clones


Automatic link correction might render fc.linkChildrenToParents unnecessary. But lots of testing would have to back up such a conclusion!


In any case, enforcing the "pasted nodes rule" policy will not be easy!


might rewrite paste-retaining-clones, perhaps basing it on the new p.archive method. Small hacks are unlikely to work.


Summary


Leo's paste-retaining-clones command has never worked as intended! Use at your own risk!


A new (small!) PR will soon add automatic link correction to all branches. This PR will feature a stringent new unit test for the link correction in c.checkVnodeLinks.


 PR #3467 will attempt a complete fix for paste-retaining-clones. This work is experimental and is likely to delay Leo 6.7.4.


Edward

Edward K. Ream

unread,
Jul 29, 2023, 5:08:38 AM7/29/23
to leo-editor
On Saturday, July 29, 2023 at 4:01:18 AM UTC-5 Edward K. Ream wrote:

> PR #3467 will attempt a complete fix for paste-retaining-clones. This work is experimental and is likely to delay Leo 6.7.4.

Félix suggests we wait until Leo 6.7.6 to enforce the "pasted nodes rule" policy. I tend to agree.

PR #3467 need only ensure that structure links are as intended. But even just that much might require considerable work.

Edward

Edward K. Ream

unread,
Jul 29, 2023, 10:24:33 AM7/29/23
to leo-e...@googlegroups.com
On Sat, Jul 29, 2023 at 4:08 AM Edward K. Ream <edre...@gmail.com> wrote:

> PR #3467 will attempt a complete fix for paste-retaining-clones.

Great news. The "Emergency" PR (PR #3468) should make paste-retaining-clones work as intended! 


The PR fixes paste-retaining-clones by replacing the hopeless fc.linkChildrenToParents with c.checkOutline!


The PR probably does not enforce the "pasted nodes rule" policy, but that's a nit.


To do: complete the unit test for the error recovery code. I'll merge the PR as soon as this task is complete.


Edward

Reply all
Reply to author
Forward
0 new messages