feat(wiki): prune empty folders after document retract
Automatically remove wiki folders that become empty when knowledge is retracted, using the durable finalize lane so pruning waits until ingest drains. Repository DeleteFolder now atomically checks emptiness to avoid races with concurrent page or child-folder writes.
This commit is contained in:
@@ -314,7 +314,7 @@ func writeWikiFolderError(c *gin.Context, err error) {
|
||||
switch {
|
||||
case stderrors.Is(err, repository.ErrWikiFolderNotFound), stderrors.Is(err, repository.ErrWikiPageNotFound):
|
||||
c.JSON(http.StatusNotFound, gin.H{"error": err.Error()})
|
||||
case stderrors.Is(err, repository.ErrWikiFolderConflict):
|
||||
case stderrors.Is(err, repository.ErrWikiFolderConflict), stderrors.Is(err, repository.ErrWikiFolderNotEmpty):
|
||||
c.JSON(http.StatusConflict, gin.H{"error": err.Error()})
|
||||
default:
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||
|
||||
Reference in New Issue
Block a user