Fix rename folder does not work - #1072
Merged
Merged
Conversation
Fixes the following warning: ** (io.elementary.mail:9075): CRITICAL **: 23:15:29.989: mail_source_list_tree_start_editing_item: assertion 'item != NULL' failed
Mails coredumps when finishing rename with the following place:
Thread 1 "io.elementary.m" received signal SIGSEGV, Segmentation fault.
mail_folder_item_model_rename_co (_data_=0x5baf932ed1d0) at ../src/FolderList/FolderItemModel.vala:184
184 yield offlinestore.rename_folder (folder_info.full_name, new_full_name, GLib.Priority.DEFAULT, cancellable);
This is because folder_info points to null when the new name is not yet taken
when offlinestore.folder_info() is called just before here.
So, rename folder_info to new_folder_info so that folder_info as a property of
FolderItemModel class is not sealed unintentionally.
lenemter
reviewed
Aug 5, 2026
Comment on lines
+1624
to
+1628
| // Keep back reference of item so that it can be accessed in Idle.add_once() | ||
| // where item is already freed | ||
| activated = item; | ||
| // Start editing after native event handlers finished else fails | ||
| Idle.add_once (() => { start_editing_item (item); }); | ||
| Idle.add_once (() => { start_editing_item (activated); }); |
Member
There was a problem hiding this comment.
I don't like that Idle is used here. Does tweaking when on_button_pressed is called fixes the issue? button_controller's propagations phase is set to capture, while default handlers run in bubble phase. Does changing the propagation phase make a difference?
Member
There was a problem hiding this comment.
I actually wonder if we can remove this whole n_press case? I don't think double-click-rename is a pattern we use anywhere else
Member
There was a problem hiding this comment.
I can't confirm that changing propagation phase fixes the issue
danirabbit
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1071
Can be rebase-merged if desired.
Changes Summary
1. ExpandableItem: Do not overwrite editable which already set
Fixes the constructor of
ExpandableItemclass overwriteseditablewhich contains value set inupdate_infos()ofFolderItemModelclass.How to validate this fix
Try adding the following debug codes against latest master:
You can see
editableflags of non-special folders are overwritten from true to false:2. SourceList: Fix double-click does not trigger rename
Fixes the following warning is shown when double-clicking the source list:
This is because
itemis already freed when the callback ofIdle.add_once()is called becauseon_button_pressed()is already returned.3. FolderItemModel: Fix coredump when deciding new name
Mails coredumps when finishing rename with the following place:
This is because
folder_infopoints to null when the new name is not yet taken whenofflinestore.folder_info()is called just before here. So, renamefolder_infotonew_folder_infoso thatfolder_infoas a property ofFolderItemModelclass is not sealed unintentionally.Checklist
Screencast.From.2026-08-05.23-54-35.mp4