blinksh / blink

Blink Mobile Shell for iOS (Mosh based)
https://blink.sh
GNU General Public License v3.0
6.17k stars 576 forks source link

Blink iOS creates an always-empty snips folder in On My iPhone local storage, even when snips storage is set to iCloud on a fresh install (re-open #2061) #2062

Open jimmy-zhening-luo opened 1 week ago

jimmy-zhening-luo commented 1 week ago

Checklist

Configuration

Version

Settings

In-App
iCloud
iPhone

Describe the bug

Repro Steps

  1. Install Blink on a fresh iPhone. (If needed, configure Blink according to settings above)
  2. Launch Blink and create a snip.
  3. Launch Files app and navigate to iCloud FilesBlinksnips. Verify the presence of your newly created snip.
  4. In Files app, navigate to On My iPhone.

Expected Behavior

Local Blink folder is hidden because there's nothing in it.

Actual Behavior

Local Blink folder is visible, because there's a single empty folder in there called snips, which always contains 0 snips.

If the snips folder is deleted, Blink automatically creates a new one on next launch.

Screenshots

✅ iCloud Drive

iCloud Drive: correct behavior

❌ On My iPhone

On My iPhone: wrong behavior

jimmy-zhening-luo commented 1 week ago

@carloscabanero, you closed my bug report #2061 without verifying resolution. I'll remind you that I am a paying customer of Blink Plus for years now, nearly since you began offering the service.

Here are my follow-up questions about this BUG:

  1. I am aware of dotfiles and how they work, and there are no dotfiles in there, as confirmed using Textastic and as confirmed by my ability to make the folder disappear by deleting the snips folder, and its reappearance only occurring on re-launching Blink. You would know this if you read my detailed bug. My question is: Why would there be a .github folder generated if I have use snips library turned OFF?

  2. Your answer would explain why there would be a snips folder on my chosen file storage location, but my file storage location is set to iCloud. See my detailed configuration above to note that I have it set to iCloud in all three places possible. If you are correct, then why is Blink creating a .github folder for a feature (snips library) that I turned OFF, in a storage location that is the opposite of the place I specified?

carloscabanero commented 1 week ago

Hi Jimmy, sorry if I closed the bug too soon, and don't take it personally. I usually do that when I think there is no malfunction and that the issue is closer to a support request. I read the Issue and in this case you are right, but I actually forgot about one reason why we made that decision back in the day.

You can see the logic that creates the folders here (advantages of being open source): https://github.com/blinksh/blink/blob/e4f5cff1f7c48e2cd84861d27671948ce9d318dc/Blink/Snippets/SnippetsLocations.swift#L70

As you can see, we always create the snips local folder, but we don't initialize the cache if we are not asked to do so, etc... And your question is on point, should we then skip initializing the Snips folder as well?

There are two reasons why back in the day (if I recall), we decided to keep it:

  1. We thought people may still want to play with the local directory, maybe copying some of the Snips there if they wanted to keep them private, etc... That's also the reason why the folder is called "snips" instead of ".snips", as we understood the user may want to keep it within its reach.
  2. What you mention as the "Expected behavior": Local Blink folder is hidden because there's nothing in it. Funny as it is, we had many questions back in the day because users couldn't find that folder. You need to touch some file or move something there from the shell to be displayed and that was creating confusion. Because for a lot of people the "Expected Behavior" was that this folder had to be initialized with Blink, we decided this could kill two birds with one stone. The alternative would have been to create a README or some sort of file there. But needing 1, we discarded this.

So answering your other questions:

  1. Why would there be a .github folder generated if I have use snips library turned OFF?
    • This was incorrect from my side. We create the snips folder but the .cache/github if you have it off.
  2. If you are correct, then why is Blink creating a .github folder for a feature (snips library) that I turned OFF, in a storage location that is the opposite of the place I specified?
    • I was not correct. We decided to create it because of Snips operation and because of the Expected Behavior with that folder.

Now, that out of the way, and that this is our "Expected Behavior", I understand you would prefer to get rid of it?

carloscabanero commented 3 days ago

Hi! Were you able to take a look at this?