unison icon indicating copy to clipboard operation
unison copied to clipboard

stale namespace dependencies output

Open stew opened this issue 3 years ago • 2 comments

I have a namespace that has some external metadata dependencies. when fix the dependencies with replace, the output of namespace.dependencies still shows the (now fixed) dependency until you restart ucm.

The following transcript will demonstrate that the dependency is still listed after it is fixed. If you run this transcript with --save-codebase and then load the codebase with ucm, namespace.dependencies will no longer show the dependency (I cannot demonstrate it in a single transcript)

INPUT


```ucm
.a.lib> builtins.merge
.b.lib> builtins.merge
```

```unison
unique type Alvarado = Alvarado Text
aardvark = Alvarado "ardvark"
```

```ucm
.a> add
```

```unison
unique type Babar = Babar Bytes
elephant = Babar 0xs0000

richard = "petty"
```

```ucm
.b> add
.> link a.aardvark b.richard
.b> namespace.dependencies
.b> replace a.aardvark b.elephant
.b> namespace.dependencies
```

OUTPUT


```ucm
  ☝️  The namespace .a.lib is empty.

.a.lib> builtins.merge

  Done.

  ☝️  The namespace .b.lib is empty.

.b.lib> builtins.merge

  Done.

```
```unison
unique type Alvarado = Alvarado Text
aardvark = Alvarado "ardvark"
```

```ucm

  I found and typechecked these definitions in scratch.u. If you
  do an `add` or `update`, here's how your codebase would
  change:
  
    ⍟ These new definitions are ok to `add`:
    
      unique type Alvarado
      aardvark : Alvarado

```
```ucm
.a> add

  ⍟ I've added these definitions:
  
    unique type Alvarado
    aardvark : Alvarado

```
```unison
unique type Babar = Babar Bytes
elephant = Babar 0xs0000

richard = "petty"
```

```ucm

  I found and typechecked these definitions in scratch.u. If you
  do an `add` or `update`, here's how your codebase would
  change:
  
    ⍟ These new definitions are ok to `add`:
    
      unique type Babar
      elephant : Babar
      richard  : Text

```
```ucm
.b> add

  ⍟ I've added these definitions:
  
    unique type Babar
    elephant : Babar
    richard  : Text

.> link a.aardvark b.richard

  Updates:
  
    1. b.richard : Text
       + 2. aardvark : Alvarado

.b> namespace.dependencies

  External dependency   Dependents in .b
  a.Alvarado            richard
                        
  a.aardvark            richard

.b> replace a.aardvark b.elephant

  Done.

.b> namespace.dependencies

  External dependency   Dependents in .b
  a.Alvarado            richard

```

stew avatar Sep 21 '22 21:09 stew

I don't think this has actually been fixed, but this transcript can't be used to demonstrate it on current ucm. So either we'd have to debug it in a ucm from 2022, and then check if the same fix applies today, or else close it.

aryairani avatar Jun 15 '24 03:06 aryairani

If the error is somehow from a stale in-memory branch then maybe project-roots will magically fix it 🤞

ChrisPenner avatar Jun 17 '24 22:06 ChrisPenner

Going to close it for the above reasons, though if we can reproduce somehow in the future, it would be good to fix.

aryairani avatar Jul 01 '24 14:07 aryairani