Dyalog / Dyalog/link

`]link.diff` and `]link.resync` see every item as unmatched for `-flatten` links

Open
#782 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
APL
Stars
26
Forks
11
Avg merge
1d 18h
Merged PRs (30d)
1

Description

For a link created with `-flatten`, `U.Diff` reports every workspace item as "Item has no corresponding file" and every file as "File has no corresponding item", even when nothing has changed. So `]link.diff` is useless, `]link.resync -proceed` re-reads and re-writes everything, the startup check in `WSLoaded` always sees a stale link, and `]link.create` after `]link.break` fails with "Destination namespace not empty", because the fix for #230 relies on finding no differences and a flattened link always reports differences.

## Reproduce

```apl
]link.create #.T G -flatten -source=dir
]link.diff #.T ⍝ nothing changed
→ #.T Item has no corresponding file
→ #.T.Foo Item has no corresponding file
→ #.T.Goo Item has no corresponding file
← G/ File has no corresponding item
← G/Foo.aplf File has no corresponding item
← G/Goo.aplf File has no corresponding item
```

Without `-flatten` the diff is empty.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue with ]link.create, ]link.diff, and ]link.resync using -flatten, then compare the results with an unflattened link. Trace the diff and link recreation path; done means an unchanged flattened link reports no differences, resync does not rewrite everything, and recreation after ]link.break succeeds.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.