"Allow Execution" reloads the wrong file when recovering auto-saved file #85011
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#85011
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Linux 4.4.0-200-lowlatency x86_64
Blender Version
2.91.2 Stable
Short description of error
If an auto-saved file is loaded but untrusted, clicking "Allow Execution" causes Blender to reload the non-autosaved version.
Exact steps for others to reproduce the error
This causes Blender drop the auto-saved file and reload the original non-autosaved version of the file!
Added subscriber: @rocketman
Added subscriber: @filedescriptor
Changed status from 'Needs Triage' to: 'Confirmed'
I can confirm this issue on the latest master. Will investigate.
Added subscriber: @mont29
I know why this is happening now, but not sure how to solve it.
Clicking the "Allow Execution" button will call
wm_block_autorun_warning_reload_with_scripts
which then will call theWM_OT_revert_mainfile
operator with theuse_scripts
property set totrue
. So it just reloads the file and allows all scripts to execute. The problem is thatWM_OT_revert_mainfile
usesBKE_main_blendfile_path(bmain)
to get the filename. The autosave saves to a specific filename (seewm_autosave_location
) but does not update thebmain->name
. So when the autosave is reloaded it loads the wrong file.In fact the exact same problem can be caused by just loading an autosave via File>Recover>Auto Save... and then trying to reload the file with File>Revert.
This also means that if the original file does no longer exist, the operator will fail.
@mont29 Do you know how we could fix this?
Added subscriber: @ideasman42
Not sure, but iirc @ideasman42 was the main dev working on this area? Would be interested to get his input here.
I guess we could forbid
allow execution
on files that where recovered from auto-save, until they are properly saved back into a regular file? Storing the state that we are currently in 'unsaved auto-saved recovered' status. Or modifyrevert_mainfile
to deal with that specific case?But I would rather not consider auto-saved recovered files as normal situation, and just prevent reloading those at all?
This issue was referenced by
7909f70f64
This issue was referenced by
d55d95b04d
Changed status from 'Confirmed' to: 'Resolved'
Changed status from 'Resolved' to: 'Confirmed'
(auto-closed when it shouldn't have).
While this is more related to the newer dialogs, I've written two fixes, but I'm not so happy with either of them.
I think a better approach would be to extend on P1914, replacing
wm_test_autorun_warning
with a more generic dynamic callback that runs at the end of the event loop (and removes it's self when no longer needed). Although it seems like overkill for this one-off case.This issue was referenced by
548d8a397c
Changed status from 'Confirmed' to: 'Resolved'