Resolve remote lifecycle landing conflicts
This commit is contained in:
@@ -465,9 +465,12 @@ func (u *ui) describeActionError(label string, err error) string {
|
||||
return ""
|
||||
}
|
||||
if errors.Is(err, webdav.ErrConflict) || strings.Contains(err.Error(), webdav.ErrConflict.Error()) {
|
||||
return fmt.Sprintf("%s failed: remote vault changed on the server; reopen the remote vault and retry", label)
|
||||
return "Save conflict: the remote vault changed. Reopen it and retry the save."
|
||||
}
|
||||
return fmt.Sprintf("%s failed: %v", label, err)
|
||||
if label == "open remote vault" {
|
||||
return fmt.Sprintf("%s failed: %v", label, err)
|
||||
}
|
||||
return err.Error()
|
||||
}
|
||||
|
||||
func (u *ui) bannerSurface() uiBanner {
|
||||
|
||||
+2
-2
@@ -557,8 +557,8 @@ func TestUIRemoteSaveConflictShowsVisibleErrorAndKeepsDirtyState(t *testing.T) {
|
||||
|
||||
u.runAction("save vault", u.saveAction)
|
||||
|
||||
if got := u.errorMessage; !strings.Contains(got, "remote vault changed on the server") {
|
||||
t.Fatalf("errorMessage = %q, want visible remote conflict guidance", got)
|
||||
if got := u.errorMessage; got != "Save conflict: the remote vault changed. Reopen it and retry the save." {
|
||||
t.Fatalf("errorMessage = %q, want normalized save conflict guidance", got)
|
||||
}
|
||||
if got := u.statusMessage; got != "" {
|
||||
t.Fatalf("statusMessage = %q, want empty after remote save conflict", got)
|
||||
|
||||
Reference in New Issue
Block a user