question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.link() with public collection with versions points to wrong file name

See original GitHub issue

I’m having an issue:

  • Give an expressive description of what is went wrong

When generating versions for a public collection and then requesting a .link() for such a version the file name does not match the file name used on disk. Example:

  "small-avif": {
    extension: "avif",
    path: "/home/.../data/images/nG69zE5Mr5X7KLvci_small.avif",
    size: 8038,
    sizeName: "small",
    type: "image/avif"
  }
}

yields https://.../images/small-avif-nG69zE5Mr5X7KLvci.avif - which I have mapped to the correct folder, but the file name is off.

  • Version of Meteor-Files you’re experiencing this issue 2.0.0
  • Version of Meteor you’re experiencing this issue 1.11.1
  • Where this issue appears? OS (Mac/Win/Linux)? Browser name and its version? Ubuntu Server 18.04
  • Is it Client or Server issue? Server

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
neopostmoderncommented, Mar 16, 2021

I write the files straight to the FS with sharp sharpHandle.toFile(targetPath)

As for .link) calls, I’m using this snippet

const getImageLink = (image, size) => {
  if (image.link) {
    return image.link(size)
  }
  return Images.link(image, size)
}

But I guess you’re explanation of how the expected filename is derived from the version key explains everything. I feel like the documentation could be more explicit about this and/or it would be nice to be able to customize this behabior – for now I’ll stick to rewriting the requests with a RegEx in nginx!

0reactions
dr-dimitrucommented, Mar 15, 2021

Hello @neopostmodern, any updates on your end?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Link returned for a file by SHARE is wrong, points to a parent folder ...
Hi,. I'm experiencing the same behavior. I find it to happen when changing the name of the parent directory. Then, the link to...
Read more >
How does Git handle symbolic links? - Stack Overflow
I would assume that it leaves it as a symbolic link until the file is deleted and then if you pull the file...
Read more >
Rename a file, folder, or link in a document library
Open the document library and hover over the file you want to rename. File name highlighted in Document Library. Click the ellipses (...)...
Read more >
Using versioning in S3 buckets - AWS Documentation
Versioning in Amazon S3 is a means of keeping multiple variants of an object in the same bucket. You can use the S3...
Read more >
Links in HTML documents - W3C
Syntax of anchor names; Nested links are illegal; Anchors with the id attribute ... The link starts at the "source" anchor and points...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found