View Issue Details

IDProjectCategoryView StatusLast Update
0036257mantisbtbugtrackerpublic2025-09-02 03:38
Reporterpikachurus Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status confirmedResolutionopen 
Product Version2.26.4 
Summary0036257: Deleted notes not showing in bug history
Description

issue was transfered from public to private project (if it's matter)

user1 (manager role in project) writes a comment (not a private), then deletes it.

user2 (also manager role in project) recieved notification (to e-mail and telegram) with this comment

user2 and even user with role administrator can't see this records (created/deleted) in bug history.

but user1 see them.

TagsNo tags attached.

Relationships

has duplicate 0036282 resolvedatrol I cannot see deleted notes 

Activities

dregad

dregad

2025-08-11 09:19

developer   ~0070431

Last edited: 2025-08-11 09:20

In history API, when processing bugnote add/change/delete events, there is a check to ensure that the bugnote exists, and if not the event is not shown. This check is bypassed for the note's creator only, which explains the behavior.

In history_get_event_from_row() function:

        if( $t_user_id != $v_user_id ) {
            # bypass if user originated note
            if( ( $v_type == BUGNOTE_ADDED ) || ( $v_type == BUGNOTE_UPDATED ) || ( $v_type == BUGNOTE_DELETED ) ) {
                if( !bugnote_exists( $v_old_value ) ) {
                    continue;
                }

This was introduced in MantisBT master-1.3.x 19736210 (see 0021878); I'm not really sure if that behavior was intentional, maybe @vboctor who authored the change will care to comment.

atrol

atrol

2025-08-11 12:00

developer   ~0070432

@dregad I would keep it as it is.
After a note was deleted, we can't check any longer if it was private before.
Even users without private_bugnote_threshold would see it in the history.

dregad

dregad

2025-08-11 13:34

developer   ~0070434

Last edited: 2025-08-11 13:36

After a note was deleted, we can't check any longer if it was private before.

That's true, but at the same time the note's content is gone so it does not really matter so much as there is no real information disclosure (just info about a note added then deleted, that user could not see before).

What I do find confusing, is that you can get a partial history. Consider the following scenario,

  1. user tdev creates a bugnote
  2. manager tmgr updates it
  3. admin tadm deletes it

This is what everyone sees at the end:

  • tdev: no update or delete
    11/08/2025 19:20    tdev    Note Added: 0070113 
  • tmgr: no create or delete
    11/08/2025 19:21    tmgr    Note Edited: 0070113    
  • tadm: no create or update
    11/08/2025 19:22    tadm    Note Deleted: 0070113   
dregad

dregad

2025-08-11 13:39

developer   ~0070435

And for the record

issue was transfered from public to private project (if it's matter)

This makes no difference, the behavior is identical regardless of project / issue view state.

dregad

dregad

2025-08-12 03:34

developer   ~0070439

I believe we have the following options:

  1. let everyone see everything
  2. add a bypass for administrators so they see all activity
  3. let all users who acted on the deleted bugnote see related activity
  4. don't change anything (users only see their own activity on the deleted note)

Option 3 sounds nice, but maintaining proper sort order would be tricky due to the way the history array is built.

I would personally go for 1 for the sake of simplicity, but if you think it's important not to disclose that a (potentially private) note was created then deleted then I would at least recommend option 2 so admins can have a complete, unfiltered view.

pikachurus

pikachurus

2025-08-15 14:01

reporter   ~0070445

Last edited: 2025-08-15 14:02

Personally, I think that access to all events in the bugs history should be configured here

Screenshot_20250815_205737.png (36,319 bytes)   
Screenshot_20250815_205737.png (36,319 bytes)   
dregad

dregad

2025-08-16 06:29

developer   ~0070446

Last edited: 2025-08-16 08:02

I don't think this is worth adding another config option to store the necessary threshold.

pikachurus

pikachurus

2025-08-18 03:48

reporter   ~0070447

no another option - in that one (View Issue History)

dregad

dregad

2025-08-19 06:00

developer   ~0070454

no another option - in that one (View Issue History)

$g_view_history_threshold controls the access to view history at a global level, but further visibility restrictions must apply on individual history items, based on context (e.g. a user may not be allowed to view private notes, or issues linked in a restricted project - and therefore should not see related history events).

What is happening here, is that since the note was deleted it is not possible to check its visibility status anymore since the database record no longer exists. Mantis currently takes the most conservative approach of only showing the event to the person that initiated it.

As mentioned before, this is a corner case that is not worth introducing a special config option to fix. We just need to decide on one of the options I outlined in 0036257:0070439.

vboctor

vboctor

2025-08-25 13:13

manager   ~0070470

@dregad

  1. let everyone see everything

That would be a privacy issue. Even the involvement of a user on an issue can be sensitive, even if the contents were deleted.

  1. add a bypass for administrators so they see all activity

I'm OK with administrators seeing everything.

  1. let all users who acted on the deleted bugnote see related activity

That is such a corner case. I don't think it is worth adding the complexity and runtime overhead. I suspect most of the time, such notes will be deleted shortly after creation - e.g. added to wrong issues. Otherwise, it is not the most common scenarios to delete old notes.

  1. don't change anything (users only see their own activity on the deleted note)

That's also fine by me.

In summary, I would go for 2 or 4.

pikachurus

pikachurus

2025-08-26 02:30

reporter   ~0070471

add a bypass for administrators so they see all activity

I think a manager should also see all bug history of his project.

dregad

dregad

2025-08-26 08:53

developer   ~0070473

a manager should also see all bug history of his project.

Makes sense. @vboctor OK with you ?

vboctor

vboctor

2025-08-26 10:18

manager   ~0070479

I think anyone who has access to view other user's private notes for the project, can see the history events of deleted notes. This will often cover DEVELOPERS, MANAGERS, and ADMINISTRATOR.

dregad

dregad

2025-08-26 12:14

developer   ~0070481

OK that makes even more sense :-)