Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Archives (zip) don't show contents #3

Closed
VictorPuga opened this issue Jun 16, 2021 · 9 comments
Closed

Archives (zip) don't show contents #3

VictorPuga opened this issue Jun 16, 2021 · 9 comments
Labels
bug Something isn't working

Comments

@VictorPuga
Copy link

Environment

  • App version: 1.3.0 (5)
  • macOS version: 11.4

Bug Information

  • What are you trying to do?
    Use QuickLook to peek at the contents of a zip file.

  • What's the expected behavior?
    Press space to open QuickLook, and a list of the contents of the zip file is shown.

  • What's the actual behavior?
    When I open QuickLook on a zip file, the only data that is displayed is the compression info, not the contents.

Example

Screen.Recording.2021-06-16.at.1.26.18.p.m.mov
@VictorPuga VictorPuga added the bug Something isn't working label Jun 16, 2021
@chamburr
Copy link
Owner

@VictorPuga Hey, I'm unable to reproduce this bug unfortunately. Just to make sure it's not an issue with the file format, could you try to run QuickLook on the archive I created here? If this works, please upload your archive, otherwise I'd need more diagnostic information.

@VictorPuga
Copy link
Author

Indeed, when I open the archive you provided, it works as expected. I will attach the zip file created by me, hoping it helps to bring some insight. May I ask with which OS version you created the file? I forgot to specify that I am using an Apple Silicon Mac.

Btw, I tried to run the project locally, but I am missing the compiled assets for htmlconverter.a and htmlconverter.h. I tried building them inside a Docker container, but I can't target the darwin arm64 architecture. Could you by any chance provide me with those files?

Test

Screen.Recording.2021-06-17.at.9.12.17.a.m.mov

Archive

Folder 2.zip

Thanks for the quick response :)

@chamburr
Copy link
Owner

I'm running Glance 1.3.0 on macOS 11.4 (20F71), but with an Intel Mac instead. My archive file is created in the same way as you did, so it's interesting how there's different results to it on your machine.

I tried your archive and still can't reproduce the issue. Based on the information you provided (specifically "p.m." before the folder name and missing modified date), I suspect there's something wrong with formatting the output. The compiled assets should be handled by the build step in Xcode if you install Go. Please download the source code, open in Xcode, and follow the debug steps below:

  1. Go to QLPlugin/Extensions/Views/Previews/ZIPPreview.swift and set a breakpoint on line 71.
  2. Select QLPlugin in the target list, run, and preview an archive file in Finder.
  3. In Xcode breakpoints view, copy the value of the result variable.

Please let me know the value of the variable when you're done.

@VictorPuga
Copy link
Author

I followed all the steps you provided, and here is the value of the variable:

Original:

result	String	"Archive: archive.zip\nZip file size: 0 bytes, number of entries: 0\ndrwxr-xr-x 2.0 unx 0 bx stor 21-Jun-17 9:12 a.m. Folder/\n-rw-r--r-- 2.0 unx 310 bx stor 21-Jun-17 9:12 a.m. __MACOSX/._Folder\n-rw-r--r-- 2.0 unx 20 bx stor 21-Jun-17 8:25 a.m. Folder/b.csv\n-rw-r--r-- 2.0 unx 312 bx stor 21-Jun-17 8:25 a.m. __MACOSX/Folder/._b.csv\n-rw-r--r-- 2.0 unx 13 bx stor 21-Jun-17 8:25 a.m. Folder/a.txt\n-rw-r--r-- 2.0 unx 312 bx stor 21-Jun-17 8:25 a.m. __MACOSX/Folder/._a.txt\n6 files, 967 bytes uncompressed, 542 bytes compressed: 44.0%"	

With line breaks:

result	String	"Archive: archive.zip\n
Zip file size: 0 bytes, number of entries: 0\n
drwxr-xr-x 2.0 unx 0 bx stor 21-Jun-17 9:12 a.m. Folder/\n
-rw-r--r-- 2.0 unx 310 bx stor 21-Jun-17 9:12 a.m. __MACOSX/._Folder\n
-rw-r--r-- 2.0 unx 20 bx stor 21-Jun-17 8:25 a.m. Folder/b.csv\n
-rw-r--r-- 2.0 unx 312 bx stor 21-Jun-17 8:25 a.m. __MACOSX/Folder/._b.csv\n
-rw-r--r-- 2.0 unx 13 bx stor 21-Jun-17 8:25 a.m. Folder/a.txt\n
-rw-r--r-- 2.0 unx 312 bx stor 21-Jun-17 8:25 a.m. __MACOSX/Folder/._a.txt\n
6 files, 967 bytes uncompressed, 542 bytes compressed: 44.0%"	

What's interesting is that the value says there are 0 entries, while in the debugger I can see there are actually 6. I will provide all the variable values from the debugger.

Screen Shot 2021-06-18 at 11 59 43 a m

Also, I noticed that the counters on the app are never updating 🙃

Screen Shot 2021-06-18 at 12 01 20 p m

@chamburr
Copy link
Owner

Thanks for the response. The "0 entries" is a placeholder and should not affect the preview. It seems to me that the cause of the issue is with locale settings, which I've attempted to fix. Could you try this version of the app, Glance.zip? (You'll need to code sign this)

For statistics, I'm aware that it is not working. There is a weird error with writing to the group container preferences, which I think is due to some macOS bug. For anyone who may know this, the error is setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access.

@VictorPuga
Copy link
Author

I downloaded the version that you provided, and it seems that is is working fine :). Thanks for your help.

I will take a look in order to fix the statistics, it should be easy since it is a shared container (I have done it before).

@chamburr
Copy link
Owner

Good to hear that it works! I've pushed the commit.

For statistics, I tried using a shared container but the Quick Look extension can't write to it. It works in its own container, but the main window can't read from it. I think that's where I was stuck at.

@VictorPuga
Copy link
Author

Should this issue be closed? Or is it better to close it when a new release is available?

@chamburr
Copy link
Owner

Yeah I'll close this issue. You can open a new issue about statistics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants