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

🐛 Walkx icon repository not using updates files - API #1206

Closed
4 tasks done
ajnart opened this issue Jul 23, 2023 · 24 comments · Fixed by #1520
Closed
4 tasks done

🐛 Walkx icon repository not using updates files - API #1206

ajnart opened this issue Jul 23, 2023 · 24 comments · Fixed by #1520
Assignees
Labels
🐛 Bug Something isn't working

Comments

@ajnart
Copy link
Owner

ajnart commented Jul 23, 2023

Environment

Docker

Version

No response

Describe the problem

@walk icon repository has now SVG icons, he spent a lot of time on it and they don’t seem to appear in homarr. I’m not sure why I’ve tried to look at it in the code but couldn’t really figure how it works.

ill assign this to you @manuel-rw since you did the icon picker component and all the logic with that ;)

Logs

No response

Context

No response

Please tick the boxes

  • I confirm that I attached the proper logs
  • I've read the docs
  • I've checked for duplicate issues
  • I've tried to debug myself
@ajnart ajnart added the 🐛 Bug Something isn't working label Jul 23, 2023
@manuel-rw
Copy link
Collaborator

Sure. I'll look into it. Thanks for assigning

@manuel-rw
Copy link
Collaborator

manuel-rw commented Jul 23, 2023

Ok, so this is what's going on:

The API route https://data.jsdelivr.com/v1/packages/gh/walkxcode/dashboard-icons@master?structure=flat returns the following item in the flat file list:

{
        "name": "/png/alpine-linux.png",
        "hash": "F2lnsPbJo2gph4hwkNwnKRBhdMsJs1jPJ2SVt68zdwQ=",
        "size": 22073
},

However, this file does not exist on the CDN data endpoint: https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons@master/png/alpine-linux.png :

Couldn't find the requested file /png/alpine-linux.png in walkxcode/dashboard-icons.

Other files, like the following work on both endpoints:

  • homarr.svg
  • homarr.png
  • alpine.png

I don't get it, why this is happening. I double checked that we request the correct branch, that there is no caching going on and that it's not my device / network being the traitor. @walkxcode can you maybe assist us on this issue?

@walkxcode
Copy link
Collaborator

walkxcode commented Jul 24, 2023

@ajnart
Copy link
Owner Author

ajnart commented Jul 24, 2023

https://data.jsdelivr.com/v1/packages/gh/walkxcode/dashboard-icons@master?structure=flat > https://data.jsdelivr.com/v1/packages/gh/walkxcode/dashboard-icons@main?structure=flat :)

This actually doesn't work?.. I'll look further into the issue.

So there’s no way of getting the up to date files ? 💀

@walkxcode
Copy link
Collaborator

There is. I just read that jsDelivr switched to a system where anything after the @ will be the NPM version tag. Problem is... There is no NPM in my project :') I'm going to try some possible fixes, and otherwise I might have to find another CDN (old CDN will still work no problem).

@ajnart
Copy link
Owner Author

ajnart commented Jul 24, 2023

@walkxcode your main branch is called “main” not “master” anymore. Maybe that’s the issue with the jsdelivr?

@walkxcode
Copy link
Collaborator

No. I've tried.

@walkxcode
Copy link
Collaborator

data.jsdelivr.com/v1/packages/gh/walkxcode/dashboard-icons@master?structure=flat > data.jsdelivr.com/v1/packages/gh/walkxcode/dashboard-icons@main?structure=flat :)
This actually doesn't work?.. I'll look further into the issue.

So there’s no way of getting the up to date files ? 💀

Yeah, I don't think it's possible...

@manuel-rw
Copy link
Collaborator

manuel-rw commented Jul 24, 2023

Does master maybe reference the first ever recorded version of the branch but not updates afterwards? If that's the case, we would have to tag a specific version instead of using master / main (eg. a commit hash). We could retrieve the latest commit hash via API and then retrieve the contents of that specific revision. Kind of breaks image caching, but probably our best bet?

@walkxcode
Copy link
Collaborator

I think that's the case, but I don't know if commit hashes will work.

@manuel-rw
Copy link
Collaborator

manuel-rw commented Jul 24, 2023

They do. It's documented in the docs. However, we need to know the hashes in the first place...

It's also weird that this issue only seems to exist for your icon repo.The other work fine.

@ajnart
Copy link
Owner Author

ajnart commented Jul 24, 2023

They do. It's documented in the docs. However, we need to know the hashes in the first place...

It's also weird that this issue only seems to exist for your icon repo.The other work fine.

Why not just use main and use the latest one ? The only issue is that the branch got renamed and the CDN didnt pick it up to alias it to main instead of master. replacing it with main should work.

@walkxcode
Copy link
Collaborator

No. It does not work, as I already said above.

@manuel-rw
Copy link
Collaborator

I can confirm that main doesn't work either.

@walkxcode walkxcode changed the title 🐛 BUG : Walks icon repository SVG files 🐛 BUG : Walkx icon repository SVG files Jul 24, 2023
@manuel-rw manuel-rw changed the title 🐛 BUG : Walkx icon repository SVG files 🐛 Walkx icon repository not using updates files - API Jul 24, 2023
@manuel-rw
Copy link
Collaborator

This API endpoint is working for me:

https://data.jsdelivr.com/v1/packages/gh/walkxcode/dashboard-icons@118c204a1c84245c98ec316e1918f42277d68248?structure=flat

{
        "name": "/png/alpine.png", // <-- correct file name, that was updated recently, as an example
        "hash": "okx+Xqqc45mGtY1o3GgZzTU+HBSnTKF9ybnpj5O/Ypw=",
        "size": 18264
}

@ajnart
Copy link
Owner Author

ajnart commented Jul 24, 2023

We could try to email jsdelivr to ask them how to get the link to the latest resources, it might be a bug on their end or something we weren’t able to find about online

@manuel-rw
Copy link
Collaborator

Interestingly, JsDelivr seems to "know" no versions:
image

@manuel-rw
Copy link
Collaborator

At least JsDelivr seems to know the project:

curl -X GET "https://data.jsdelivr.com/v1/stats/packages/gh/walkxcode/dashboard-icons?period=week" \
 -H "accept: application/json" \
{
  "hits": {
    "rank": 817,
    "typeRank": 273,
    "total": 2077449,
    "dates": {
      "2022-10-15": 311693,
      "2022-10-16": 334698,
      "2022-10-17": 283700,
      "2022-10-18": 266822,
      "2022-10-19": 263361,
      "2022-10-20": 319285,
      "2022-10-21": 297890
    },
    "prev": {
      "rank": 819,
      "typeRank": 269,
      "total": 2038555
    }
  },
  "bandwidth": {
    "rank": 1174,
    "typeRank": 608,
    "total": 33431191086,
    "dates": {
      "2022-10-15": 5148082281,
      "2022-10-16": 5449361001,
      "2022-10-17": 4642068503,
      "2022-10-18": 4460342994,
      "2022-10-19": 4497136347,
      "2022-10-20": 4590028290,
      "2022-10-21": 4644171670
    },
    "prev": {
      "rank": 1160,
      "typeRank": 607,
      "total": 34557768886
    }
  },
  "links": {
    "self": "https://data.jsdelivr.com/v1/stats/packages/gh/twbs/bootstrap?period=week",
    "versions": "https://data.jsdelivr.com/v1/stats/packages/gh/twbs/bootstrap/versions?period=week"
  }
}

@ajnart
Copy link
Owner Author

ajnart commented Jul 24, 2023

At least JsDelivr seems to know the project:

curl -X GET "https://data.jsdelivr.com/v1/stats/packages/gh/walkxcode/dashboard-icons?period=week" \
 -H "accept: application/json" \
{
  "hits": {
    "rank": 817,
    "typeRank": 273,
    "total": 2077449,
    "dates": {
      "2022-10-15": 311693,
      "2022-10-16": 334698,
      "2022-10-17": 283700,
      "2022-10-18": 266822,
      "2022-10-19": 263361,
      "2022-10-20": 319285,
      "2022-10-21": 297890
    },
    "prev": {
      "rank": 819,
      "typeRank": 269,
      "total": 2038555
    }
  },
  "bandwidth": {
    "rank": 1174,
    "typeRank": 608,
    "total": 33431191086,
    "dates": {
      "2022-10-15": 5148082281,
      "2022-10-16": 5449361001,
      "2022-10-17": 4642068503,
      "2022-10-18": 4460342994,
      "2022-10-19": 4497136347,
      "2022-10-20": 4590028290,
      "2022-10-21": 4644171670
    },
    "prev": {
      "rank": 1160,
      "typeRank": 607,
      "total": 34557768886
    }
  },
  "links": {
    "self": "https://data.jsdelivr.com/v1/stats/packages/gh/twbs/bootstrap?period=week",
    "versions": "https://data.jsdelivr.com/v1/stats/packages/gh/twbs/bootstrap/versions?period=week"
  }
}

But why are the dates so far in time ?

@manuel-rw
Copy link
Collaborator

manuel-rw commented Jul 25, 2023

According to jsdelivr/jsdelivr#18417 (comment) , it should update within 12 hours. I tried purging the cache using https://purge.jsdelivr.net/walkxcode/dashboard-icons@main, but that didn't change anything (or it takes longer to propagate to the CDN).
video-dev/hls.js#1664 (comment)

https://stackoverflow.com/a/69151200

Maybe we need to wait now? 🤔

Related to mavoweb/mavo#603

@ajnart
Copy link
Owner Author

ajnart commented Oct 25, 2023

Is this still an issue ? Im not sure

@walkxcode
Copy link
Collaborator

Yes it is

@walkxcode
Copy link
Collaborator

@ajnart
Copy link
Owner Author

ajnart commented Nov 7, 2023

Fixed with #1520

@ajnart ajnart closed this as completed Nov 7, 2023
@ajnart ajnart unpinned this issue Nov 7, 2023
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

Successfully merging a pull request may close this issue.

3 participants