-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bugfix: update no longer tries to put non-test watches into the namespace #4454
Conversation
goTerm (_, r, Nothing, tm, tp) = putTerm c r tm tp | ||
goTerm (_, r, Just WK.TestWatch, tm, tp) = putTerm c r tm tp | ||
goTerm _ = pure () | ||
goTerm (_, r, wk, tm, tp) = when (WK.watchKindShouldBeStoredInDatabase wk) (putTerm c r tm tp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactor, no change in behavior
in [ BranchUtil.makeAnnihilateTermName split, | ||
BranchUtil.makeAddTermName split (Referent.fromTermReferenceId ref) Map.empty | ||
] | ||
& foldMap \(var, (_, ref, wk, _, _)) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the bugfix. before, we didn't look at wk
. now, we do.
where | ||
terms = keysToNames $ UF.hashTermsId tuf | ||
terms = | ||
UF.hashTermsId tuf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there was a similar issue here in just extracting type/term names; I'm not sure if it directly contributed to the crash, but we simply don't want watches that aren't "test" watches here, either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Overview
Fixes #4438
Implementation notes
update
no longer tries to put all terms found in a Unison file into the namespace: just those that either don't have a watch kind, or those whose watch kind is"test"
.Test coverage
Transcript included.
Loose ends
The same bug still exists in
add
andupdate.old
. Fixing it inupdate
unfortunately didn't fix it over there for free.