dap-ps / discover

Discover a whole new world of curated decentralised applications
https://dap.ps
Mozilla Public License 2.0
21 stars 9 forks source link

dev.dap.ps is empty on IOS (develop 09.08.2019) #16

Closed churik closed 4 years ago

churik commented 5 years ago

Description

Type: Bug Summary: no dapps on dev.dap.ps on latest nightly, but they are shown for release 0.13.0

Expected behavior

can see dapps list

Actual behavior

IMG_A0A94BB6095F-1

Reproduction

Additional Information

andytudhope commented 5 years ago

Yeah, this was likely because we were working on it at the moment you tried. I am fairly sure this is fixed now so am happy to close. If you feel differently, please re-open.

churik commented 5 years ago

@andytudhope No, it is still empty for IOS on current develop. All fine on IOS (release 0.13.0) and on Android (current develop)

andytudhope commented 5 years ago

Can you clear your cache? It's really strange that it would work everywhere but on a specific branch & device...

andytudhope commented 5 years ago

Please check this again when you get a chance, would be interesting to see if it is still empty with anew contract instance etc.

churik commented 5 years ago

@andytudhope it is the same for me. Asked Nastya to check on her side.

asemiankevich commented 5 years ago

@andytudhope same to me with iOS 13 Beta 4 (not sure if it matters).

image

image

andytudhope commented 5 years ago

Yeah, it definitely matters @asemiankevich... I'm just not sure what to do about it :sweat_smile: Is there any way you can clear your cache in Status? It's weird that it would load everywhere but on a a particular device. Any chance you could get web console logs to see if there's a clue there as to what might be happening?

churik commented 5 years ago

@andytudhope I don't know how to clear cache in Status, in my case, I'm just creating new account. And this is not about device as far as I understand - it is about the latest develop particularly on IOS. All fine on 0.13.0 on IOS.

andytudhope commented 5 years ago

Ah, so it's the Status version... OK, any logs at all that you can get would be a good starting point...

churik commented 5 years ago

That's all I can get for IOS: geth.log Just in case all app data (ping me for passwords): im.status.ethereum.zip

andytudhope commented 5 years ago

Ha, it's hilarious trying to go through that... Anyway, here are some (maybe?) relevant parts:

t=2019-08-08T15:14:03+0000 lvl=eror msg="failed to get transfer in between two bloks" from=1600000 to=1700000 error="Post https://ropsten.infura.io/v3/f315575765b14720b32382a61a89341a: context deadline exceeded"
t=2019-08-08T15:14:03+0000 lvl=eror msg="failed to get next batch" error="Post https://ropsten.infura.io/v3/f315575765b14720b32382a61a89341a: context deadline exceeded"

t=2019-08-08T15:20:01+0000 lvl=eror msg="failed to get transfers" header=0x2e95c5206760e8eb0c1e9143a4d956c73b22607153da0f184a04f93245c6f76b error="Post https://ropsten.infura.io/v3/f315575765b14720b32382a61a89341a: context deadline exceeded"

t=2019-08-08T15:22:43+0000 lvl=eror msg="error while sending a contact code" namespace=Publisher site=tickerLoop error="sql: database is closed"

t=2019-08-09T09:36:44+0000 lvl=eror msg="failed to get transfers" header=0x6515571d96bd3885044d386cb519c95f669ef1b32d2c401e02af565925c8186d error="Post https://ropsten.infura.io/v3/f315575765b14720b32382a61a89341a: read tcp 192.168.1.15:61847->18.213.179.40:443: read: socket is not connected"
churik commented 5 years ago

I believe you only need to check logs for last 10 mins (I created new account, switched to Ropsten and accessed de.dap.ps) Sorry that didn't mention this earlier

andytudhope commented 4 years ago

@flexsurfer are you able to replicate this on iOS. I have an Linux machine and am travelling, so not able to replicate it at all. We need to try and figure out what is causing this on the latest release so that we can fix it. The logs attached to this issue are less than useless, so any insight you could help provide would be super beneficial in terms of getting this fixed...

flexsurfer commented 4 years ago

image

flexsurfer commented 4 years ago

i'm not sure if this is the reason, because i can see a list on ios even with these errors, how do you load a list of dapps ? do you get them from contract through web3 request? i can't see any logs in status

flexsurfer commented 4 years ago

ok if permission "always allow" i can see the XHR . request, image

if not i can see error image

andytudhope commented 4 years ago

@iamonuwa are you able to look at this in the next 2 days? If so, I will create a bounty here ASAP.

@flexsurfer, yeah that is how we load them here and here

gitcoinbot commented 4 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 120.0 DAI (120.0 USD @ $1.0/DAI) attached to it.

gitcoinbot commented 4 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 2 weeks from now. Please review their action plans below:

1) iamonuwa has been approved to start work.

This is a known issue on all platforms.

  1. Investigate the problem (IndexedDB)
  2. Fix the problem.

ETA 3 days

Learn more on the Gitcoin Issue Details page.

iamonuwa commented 4 years ago

@andytudhope you'll have the fix tonight

gitcoinbot commented 4 years ago

@iamonuwa Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

andytudhope commented 4 years ago

Hey @iamonuwa - what is happening here? Even a small update would help me understand the blocking issue better.

andytudhope commented 4 years ago

Hello @iamonuwa? Testing, testing, 1 2 3?

iamonuwa commented 4 years ago

@andytudhope the code looks good, I can't reproduce this on any of the devices I've tested it on. @churik here are my thoughts

  1. Ensure you are on a web3 enabled device.
  2. You are on the right network (mainnet) in this case.

The app will load on a browser without web3 but cannot pull data from the contract. If you use a wrong contract, it will also fail.

churik commented 4 years ago

@iamonuwa which build are you using for testing?

churik commented 4 years ago

I can reproduce issue: 1) on released build, 0.13.2, URL: https://dap.ps, IPhone XS, IOS 12 2) on current develop build, URL: https://dap.ps, IPhone 7, IOS 11.4.1

andytudhope commented 4 years ago

Yeah, there's something specific that is wrong with iOS on the latest version of Status @iamonuwa

Do you have the capacity to test on an iOS device/simulator? Because I don't and that is what is preventing me from digging further into this.

iamonuwa commented 4 years ago

@churik @andytudhope this error happens on all devices when you are on the wrong network. I've tried it on iOS 13. It works when am on the right network but fails on wrong network

iamonuwa commented 4 years ago

@iamonuwa which build are you using for testing?

0.13.0 on android and iOS

andytudhope commented 4 years ago

This is the issue that keeps on giving... @flexsurfer do you have any further feedback you could give here?

gitcoinbot commented 4 years ago

@iamonuwa Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot commented 4 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


@iamonuwa due to inactivity, we have escalated this issue to Gitcoin's moderation team. Let us know if you believe this has been done in error!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

andytudhope commented 4 years ago

Ok, I'm gonna have one more go at this.

@iamonuwa the code is not good - it should not require a web3 enabled device/browser just to view the DApps ranked on the site. This is why we only request web3 access when you're trying to stake SNT on a DApp, or vote. It is important that we keep that request where it is, but make sure the DApps load without issue, even when permission has not been allowed (see flexsurfer's comment above).

There are 2 separate issues afaict and maybe @jakubgs can help, seeing as no-one else has been able to so far?

  1. There is a CORS issue with infura when you have no web3 provider. This is likely easy to solve.

  2. Even when there is no web3 provider, we're still trying to connect to a "blockchain node" and we shouldn't. We should just fetch the ranked DApps from the contract via infura, list the other DApps from our DB and be done with it. i.e. we need to improve error handling in the case of no web3 provider.

Do you think you could handle this, or do I need to find someone else for this bounty?

jakubgs commented 4 years ago

There is a CORS issue with infura when you have no web3 provider. This is likely easy to solve.

No idea what that's about, you're going to have to elaborate on that. What is a "web3 provider"?

Even when there is no web3 provider, we're still trying to connect to a "blockchain node" and we shouldn't.

What "blockchain node"? Not sure what you are talking about here either.

andytudhope commented 4 years ago
  1. Metamask, Status, and other wallets provide a web3 object, which contains info about your account etc. If this is not present, then something weird happens with our request to Infura (a request in which we are fetching all the DApps currently ranked in the contract). To replicate these errors, disable MetaMask in your browser, and then browse to https://dap.ps to see what happens.
    
    Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://mainnet.infura.io/v3/8675214b97b44e96b70d05326c61fd6a. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://mainnet.infura.io/v3/8675214b97b44e96b70d05326c61fd6a. (Reason: CORS request did not succeed).



2. I basically want @iamonuwa to fix this shitty piece of code: https://github.com/dap-ps/discover/blob/master/src/modules/Dapps/Dapps.reducer.js#L55 so that it actually handles the error when there is no provider set and doesn't end up failing so badly and not loading any DApps at all. In the case where there is no provider - and if we can't figure out why infura is giving us issues -  then we should just load the DApps in our DB and be done with it.
jakubgs commented 4 years ago

I am unable to reproduce the CORS issue. At all. When I have no MetaMask enabled in my browser then https://dap.ps/ loads without a single error in the browser console.

andytudhope commented 4 years ago

Ok, don't stress about it - @iamonuwa is fixing what I asked him to above, and we can see if it is still a problem once that PR is in and merged.

iamonuwa commented 4 years ago

Am working on this.

gitcoinbot commented 4 years ago

@iamonuwa Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

iamonuwa commented 4 years ago

@gitcoinbot wow! Take a chill pill man. Am trying to fix this.

iamonuwa commented 4 years ago

@andytudhope @jakubgs so I've been digging this error for so long. Here are some more findings

  1. Without MM, the app will crash
  2. Firefox privacy doesn't support indexeddb.
  3. There is no onReady method inside EmbarkJS https://github.com/dap-ps/discover/blob/bf8b9bcbad0a4dec550a9d98a27fb62f7b8a38ce/src/common/blockchain/index.js#L33
andytudhope commented 4 years ago

OK @iamonuwa

  1. Why does the app crash? It should not require a web3 provider just to view the site.
  2. Are the issues with indexDB what is causing the issue with iOS?
  3. I will ask about this in the Embark gitter.
gitcoinbot commented 4 years ago

@iamonuwa Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot commented 4 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


@iamonuwa due to inactivity, we have escalated this issue to Gitcoin's moderation team. Let us know if you believe this has been done in error!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

flexsurfer commented 4 years ago

And it takes a long time to load the list on Android

jakubgs commented 4 years ago

@flexsurfer I think this is caused by https://github.com/dap-ps/discover/issues/54, but I can't test my proposed fix because https://dev.dap.ps/ seems fucked.

jakubgs commented 4 years ago

@iamonuwa any news, or should I take this over?

andytudhope commented 4 years ago

Hey @jakubgs - am traveling atm, hence intermittent connection. What is the issue you are having with dev.dap.ps - it works well for me? Are you sure that MetaMask is connected to Ropsten?

Screenshot from 2019-12-02 09-52-10

jakubgs commented 4 years ago

You're right, I was not on ropsten, but something bigger is broken, because it's not lading at all in tests: https://www.webpagetest.org/result/191202_BT_bbfdedd7c72a287084cb332582c4236b/ Look at the screenshot, there are no apps.

andytudhope commented 4 years ago

Hmm. Fair enough. There is definitely a LOT that can be fixed, but I was waiting for liquid funding to be a thing before really trying to engage people again given my experience last time around, with all those fun budget problems I ran into halfway through the scoped work...