userscripts icon indicating copy to clipboard operation
userscripts copied to clipboard

Userscripts editor auto delete iCloud script files.

Open SunBK201 opened this issue 2 years ago • 8 comments

"⌘+S"(Save) has a certain probability of automatically deleting the script file stored in iCloud

OS: macOS 12

SunBK201 avatar Sep 15 '22 11:09 SunBK201

@SunBK201

Can you share more info? Why do you believe this is the case? Is there a code level issue? What have you experienced? Does it only affect the keyboard shortcut ⌘+Sor on any save action?

I will need more details to properly debug this.

quoid avatar Sep 15 '22 12:09 quoid

https://user-images.githubusercontent.com/49178170/190406061-942af313-9768-488f-be8e-cb45bb5066ad.mp4

SunBK201 avatar Sep 15 '22 12:09 SunBK201

This bug will only appear when entering the editor for the first time (refresh editor page), and will not be triggered when editing and saving again.

SunBK201 avatar Sep 15 '22 12:09 SunBK201

@SunBK201 Thank you very much for the video. I am trying to reproduce this on my machine, but not having luck.

Edit: see next response

quoid avatar Sep 15 '22 13:09 quoid

@SunBK201

Ok, I can see the problem, I believe. Can you you verify the following?

Did you create this userscript in an external editor and then drag it into your userscripts folder?

The reason I ask is because there is a difference between the @name value and the filename value, which could be the source the of the bug. I assume you created this in an external editor or manually changed your filename.

  • @name Zhihu-AD
  • filename ZhiHu-AD

I believe this is being treated as a filename change, which is the only time items are moved to trash.

These situations are not being handled properly, marking as bug.

quoid avatar Sep 15 '22 13:09 quoid

@SunBK201

Ok, I can see the problem, I believe. Can you you verify the following?

Did you create this userscript in an external editor and then drag it into your userscripts folder?

The reason I ask is because there is a difference between the @name value and the filename value, which could be the source the of the bug. I assume you created this in an external editor or manually changed your filename.

  • @name Zhihu-AD
  • filename ZhiHu-AD

I believe this is being treated as a filename change, which is the only time items are moved to trash.

These situations are not being handled properly, marking as bug.

Yes, I manually changed userscript folder to the iCloud folder and moved all scripts from the original folder to the new iCloud folder.

SunBK201 avatar Sep 15 '22 13:09 SunBK201

@SunBK201 thanks for confirming, will fix this bug.

For now, if you keep filename and @name value the same, this bug should not appear.

quoid avatar Sep 15 '22 14:09 quoid

@SunBK201 thanks for confirming, will fix this bug.

For now, if you keep filename and @name value the same, this bug should not appear.

thanks

SunBK201 avatar Sep 15 '22 14:09 SunBK201