Skip to content

Commit

Permalink
fix for #883
Browse files Browse the repository at this point in the history
  • Loading branch information
or-else committed Aug 24, 2023
1 parent 47cda76 commit 452e5bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/db/rethinkdb/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,7 @@ func (a *adapter) UserDelete(uid t.Uid, hard bool) error {
return err
}

// Must use GetAll to produce array result expected by decFileUseCounter.
q := rdb.DB(a.dbName).Table("users").GetAll(uid.String())

// Unlink user's attachment.
Expand Down Expand Up @@ -1567,7 +1568,8 @@ func (a *adapter) TopicDelete(topic string, isChan, hard bool) error {
}
}

q := rdb.DB(a.dbName).Table("topics").Get(topic)
// Must use GetAll to produce array result expected by decFileUseCounter.
q := rdb.DB(a.dbName).Table("topics").GetAll(topic)
if hard {
if err = a.decFileUseCounter(q); err == nil {
_, err = q.Delete().RunWrite(a.conn)
Expand Down

0 comments on commit 452e5bb

Please sign in to comment.