Danacus / node-factorio-api

Download and update mods from the Factorio Mod Portal
3 stars 2 forks source link

Does not refresh old cache #9

Open Danielv123 opened 6 years ago

Danielv123 commented 6 years ago

I search for a mod

factorioAPI.searchMods("clusterio").then(body => {console.log(body)});

and I get the following


[ { name: 'clusterio',
    title: 'Clusterio',
    owner: 'Danielv123',
    summary: 'Allows transfer of items and signals between servers. *Server owners, see https://github.com/Danielv123/factorioClusterio for installation instructions*',
    downloads_count: 408,
    latest_release:
     { download_url: '/download/clusterio/5a646a09abfdfa000b25dc56',
       file_name: 'clusterio_1.5.2.zip',
       info_json: [Object],
       released_at: '2018-01-21T10:23:05.728000Z',
       version: '1.5.2',
       sha1: '6d741050a060762fcb110caedaab0b072511cced' } } ]```

Now as we can see from the portal page, this is a few months late. https://mods.factorio.com/mod/clusterio/downloads

This is because the local cache you introduced was never invalidated. Could you add a thing for invalidating the cache after an hour or something?
Danacus commented 6 years ago

Yeah, good point, the cache should actually invalidate over some time. But does it actually work when you force it to reload the cache?

Btw while I'm at it I might as well tell you that I'm moving to gitlab because of things you might have heard about. I just don't like big companies that only want more money. I'm also planning to rewrite the whole thing, since the code is a complete mess right now. But first I have to complete my exams and graduate from high school.

Danielv123 commented 6 years ago

Sorry for not responding, I think the git email response thing is broken. Yes, it did work when I deleted the cache. And while I don't agree that the microsoft acquisition is a problem and actually think they are good for the open source community, I understand your decision.

Could you add a link to the new repo to the top of your readme?

Danacus commented 6 years ago

Microsofts main goal is to make more money. They're trying to be the nice guy in the open source community, but at the end of the day they just want more money. Here's the most obvious example: they're selling a bloated operating system for way too much money, they force people to use it (kind of). They're just stealing money by selling junk. That's called capitalism. They don't really care about the open source community, they're just pretending to care. VS code is the only good thing they ever did, but I think it's just their way to gain trust. But I'll stop discussing, maybe it's just me being a communistic, anti-capitalistic Linux nerd. I understand that as long as there is no actual problem, there's actually no reason to leave GitHub. I don't mind if people want to stay on GitHub, this is just my personal view on the situation.

Here's the link to the new repository: https://gitlab.com/Danacus/node-factorio-api

I'm sorry for the struggle, I really hope you don't mind that I'm moving to gitlab, but I just can't trust big companies like Microsoft.

About the actual issue, I looked at the code and I don't get it. It's supposed to reload the cache every time you login. How are you authenticating node-factorio-api? I might be missing something. The latest update on npm is most likely completely pointless, I just wanted to make sure.

Danielv123 commented 6 years ago

Yeah, I also believe american corporations need more regulations. But my view is that if open source can make them money, they will support open source and make more money. At the same time I will get better tools, which is nice.

My views on windows on the other hand....

All of my use of your library happens in https://github.com/Danielv123/factorioClusterio/blob/master/lib/manager/modManager.js

If you can't find whats wrong we should probably close this and see if it reappears later.

Danielv123 commented 6 years ago

Also, I don't have permission to see your gitlab link.

Danacus commented 6 years ago

I changed the repository to public, I didn't realise it was still private. You should be able to access it now, but if you have any issues you can tell me. I'm still learning how gitlab works.

I think I'll close this issue and it'll probably work fine when I rewrite the code. It's such a mess right now that I wouldn't be surprised if I there's something wrong that's causing the issue.

One of my ideas is to add a front-end CLI and or GUI, but I'm not sure if I'll ever get to it.