amilajack / popcorn-time-desktop

🍿 πŸ• 🎞 A Modern Popcorn Time Client
MIT License
469 stars 109 forks source link

Development Issue : Not able to fetch torrents while using development build #175

Closed karuppiah7890 closed 8 years ago

karuppiah7890 commented 8 years ago

@amilajack Hey, I got the App's src files and npm packages and modified some source code and finally did

npm run dev

and was trying to watch a movie. But all it said was "Fetching torrents". Later, I discarded all my changes and tried it all again and still wasn't able to get the torrents loaded.

I was confused, and then I deleted everything and got all the src files again from scratch and redid everything. Still wasn't able to load the torrents. Finally to be sure, I packaged the App using

npm run package

and it packaged the App in the releases directory and when I run the packaged App, I am able to fetch the torrents and the "Start 720p" and other buttons get enabled. I am pretty confused now.

What have I done wrong ? Is it something about the .env file ? But I just copied it from the .env.example file and never changed it. And I think it looks fine.

And when I do API tests using npm run test-api, a lot of tests are failing, including "getting torrents and their magnets for 720p and 1080p" test. I am attaching the images of the test over here.

Image 1 : 1

Image 2 : 2

Image 3 : 3

Image 4 : 4

Image 5 : 5

Please do help me with this!

amilajack commented 8 years ago

Here's why the tests are failing:

  1. Expected 300 to be above 400: This is failing because the torrent provider isnt returning the optimal amount of seeders. Obviously the seeder counts of torrents change over time so testing against this was somewhat unusual but I wanted to assert somehow that we were retrieving an optimal amount of seeders for each provider. For example, if I make a change to a provider, i dont want the seeders to suddenly go from ~400 to 100.
  2. Timeout exceeded: This is failing probably because the endpoint is either blocked or the provider's endpoint is down. This this is one of the most common reasons for test failure.

3, 4. Expected undefined to be a string: I just noticed this on my build today as well. I made the tests even stricter and fixed the issue causing this πŸ˜„

Not able to fetch torrents

So are you not getting any torrents at all or are you talking about how you can't get torrents for a specific provider?

Please lmk if you have any more questions!

karuppiah7890 commented 8 years ago

And what about the torrents not fetching in development build ? But when I package and use the App, the torrent is fetched.

amilajack commented 8 years ago

What errors are you getting in the console?

karuppiah7890 commented 8 years ago

That's the problem, I don't get any errors in the developer tools. But just now I got an error when i tried some totally new movie, and it said said some "Type error" and said "Can't write to a read only object".

On Oct 8, 2016 10:08 PM, "Amila Welihinda" notifications@github.com wrote:

What errors are you getting in the console?

β€” You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/amilajack/popcorn-time-desktop/issues/175#issuecomment-252434637, or mute the thread https://github.com/notifications/unsubscribe-auth/AMNw6FmWT450r4JgYC7oVGXe5Gad73Dvks5qx8cCgaJpZM4KRpp6 .

karuppiah7890 commented 8 years ago

I get this :

Movie.js:559

TypeError: Cannot assign to read only property '0' of object '[object Array]' at Array.sort (native) at sortTorrentsBySeeders (webpack:///./app/api/torrents/BaseTorrentProvider.js?:278:19) at selectTorrents (webpack:///./app/api/torrents/TorrentAdapter.js?:272:71) at _callee$ (webpack:///./app/api/torrents/TorrentAdapter.js?:116:28) at tryCatch (webpack:///./~/regenerator-runtime/runtime.js?:62:40) at GeneratorFunctionPrototype.invoke as _invoke at GeneratorFunctionPrototype.prototype.(anonymous function) as next at tryCatch (webpack:///./~/regenerator-runtime/runtime.js?:62:40) at GeneratorFunctionPrototype.invoke as _invoke at GeneratorFunctionPrototype.prototype.(anonymous function) as next at step (webpack:///./~/babel-runtime/helpers/asyncToGenerator.js?:17:30) at eval (webpack:///./~/babel-runtime/helpers/asyncToGenerator.js?:28:20)

Image :

error

amilajack commented 8 years ago

Hmm. That's weird. Are you sure you have the most recent changes of ui-design-implementation branch?

amilajack commented 8 years ago

Oh wait you aren't on that branch at all. Here's the steps for building in case you missed them. I can't guarantee any other branch works properly. The only one I can guarantee is the ui-design-implementation branch because that's what I'm working on now. That branch will be merged into release-0.0.6-alpha and that will be merged into master. This will all happen (hopefully) in the course of 2-3 months.

amilajack commented 8 years ago

Update: I've just merged the ui-design-implementation branch into the release-0.0.6-alpha branch. You don't have to switch branches but you should if you want to receive updates in the future.

Here's the overview of how branches are merged

release-x.x.x-alpha => dev-master => master
karuppiah7890 commented 8 years ago

@amilajack I am sorry for bothering you so much for this issue.

And yeah, I get it that I should use the ui-design-implementation branch to get new updates. But I am on the master branch, which I believe is stable, and I have packaged the App using npm run package in the master branch and everything works fine in the packaged App, including the fetching of torrents and showing the movie. But when I use the development build using npm run dev on the master branch, I am not able to fetch torrents and not able to see any movie. Why is this so ? It's absurd.

And if I want to make a pull request, should it be pointed to the master branch or dev-master or release-x.x.x-alpha or what ?

amilajack commented 8 years ago

And if I want to make a pull request, should it be pointed to the master branch or dev-master or release-x.x.x-alpha or what ?

All PR's should be made to release-x.x.x-alpha

But I am on the master branch, which I believe is stable

Unfortunately it isnt. Both travis and appveyor builds are failing on it:

screen shot 2016-10-08 at 10 50 02 pm

Currently release-0.0.6-alpha is the most stable.

karuppiah7890 commented 8 years ago

Damn. Then how is my packaged App alone working ? It was packaged using master branch code

karuppiah7890 commented 8 years ago

And yeah, I will get the release-x.x.x-alpha code. And can we please make all this clear in the CONTRIBUTE.md ? Helps newbies like me, who didn't notice the build badges. And it will also help everyone to know which branch to contribute to.

amilajack commented 8 years ago

Webpack has separate build steps for production and development environments. dev env is significantly slower and has much more deps. production webpack config strips everything out and optimizes js as much as it can.

karuppiah7890 commented 8 years ago

Oh, okay. Thanks for the info. I guess I will just use the release-x.x.x-alpha branch

amilajack commented 8 years ago

And can we please make all this clear in the CONTRIBUTE.md

This is definitely a good idea. This would clear up so much unnecessary confusion. Sorry about that! I have a number of weird conventions for this project but I think they'll pay off in the end. The reason why there's a release-x.x.x-alpha branch is so that all the members of the team know what is the latest release. Also if we want to patch an old release, we can do that. Also if you haven't seen it yet, here's the roadmap.

amilajack commented 8 years ago

Just added a PR section to the CONTRIBUTING.md. Thanks for the suggestion!

amilajack commented 8 years ago

Let me know if the issue persists in that branch. If it does then I'll reopen the issue

karuppiah7890 commented 8 years ago

No, the issue doesn't persist in the release-0.0.6-alpha branch