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

fix: Fix error when viewing current version #2584

Merged
merged 2 commits into from
Oct 10, 2024
Merged

Conversation

juliusknorr
Copy link
Member

@juliusknorr juliusknorr commented Oct 10, 2024

Noticed in text cypress tests:

Steps to reproduce:

  • Open the version sidebar
  • Click on current version

Before this change we had an error thrown:

SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
    ee viewer-main.mjs:2
    canDownload viewer-main.mjs:8
    get logger-CYBBkF-8.chunk.mjs:2
    evaluate logger-CYBBkF-8.chunk.mjs:2
    Il logger-CYBBkF-8.chunk.mjs:2

Honestly I'm not sure where exactly to fix this best, but this seemed like the smallest change that wouldn't cause further side effects.

Viewer previously assumed a string for the share attributes however the fileInfo that the files app passes along through the version sidebar is holding an array as the JSON string is parsed in https://github.com/nextcloud/server/blob/d537050f19b264f96d86a564770835ae36ab9add/core/src/files/client.js#L398-L408

@juliusknorr juliusknorr added bug Something isn't working 3. to review Waiting for reviews labels Oct 10, 2024
@juliusknorr juliusknorr added this to the Nextcloud 31 milestone Oct 10, 2024
Copy link
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really would love a new version using our classes from @nextcloud/files instead of FileInfo but until then this is good :)

@juliusknorr
Copy link
Member Author

/compile

Signed-off-by: nextcloud-command <[email protected]>
@juliusknorr juliusknorr merged commit a411bbf into master Oct 10, 2024
30 checks passed
@juliusknorr juliusknorr deleted the fix/version-viewer branch October 10, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants