Giveth / giveth-dapps-v2

This project is the aggregation of GIVeconomy and Giveth.io DApps in a single repo
https://staging.giveth.io
GNU General Public License v3.0
61 stars 34 forks source link

GIVbacks round on prod is saying we're in round 0(For chains that we dont have subgraph address for them in the config) #4601

Closed laurenluz closed 1 month ago

laurenluz commented 1 month ago

not sure what round we're in but it's not 0!

@mohammadranjbarz can you help assign the right person?

image

mohammadranjbarz commented 1 month ago

It should have been your network problem and maybe some request has failed, because it shows me correct value

Screenshot 1403-05-31 at 5 48 48 in the afternoon
laurenluz commented 1 month ago

it persists for me 🤔 image

mohammadranjbarz commented 1 month ago

it persists for me 🤔 image

@geleeroyale It might be unrelated to this issue but it seems we dont have NEXT_PUBLIC_SUBGRAPH_CLASSIC in vercel Environment variables so it uses the http://167.172.97.150:8000/subgraphs/name/giveth/etc ( In the production.tsx it says to use that url if NEXT_PUBLIC_SUBGRAPH_CLASSIC not exists

    CLASSIC_CONFIG: {
        ...classic,
        chainType: ChainType.EVM,
        gasPreference: {
            // Keep it empty for automatic configuration
        },
        subgraphAddress:
            process.env.NEXT_PUBLIC_SUBGRAPH_CLASSIC ||
            'http://167.172.97.150:8000/subgraphs/name/giveth/etc',

) and because it's not a https address Chrome blocks it.

geleeroyale commented 1 month ago

@mohammadranjbarz Nice catch! But please advise. What would be the correct setting for the env value (which subgraph) - adding the vars is easy enough

Edit: I just figured out this is probably our self deployed ETH classic node. I can set a reverse proxy and request a certificate so we can have secure connections

geleeroyale commented 1 month ago

@laurenluz Yes - I can confirm. You found a bug. It seems that the givbacks round is only displayed on networks: Ethereum, Gnosis, Op mainnet. I could observe the Givbacks round 0 bug on all other supported networks like Base, Celo, ETC, Arbitrum, zkEVM, and also when no network was connected (i.e. Safari on Ipad)

mohammadranjbarz commented 1 month ago

@laurenluz Yes - I can confirm. You found a bug. It seems that the givbacks round is only displayed on networks: Ethereum, Gnosis, Op mainnet. I could observe the Givbacks round 0 bug on all other supported networks like Base, Celo, ETC, Arbitrum, zkEVM, and also when no network was connected (i.e. Safari on Ipad)

Thanks @geleeroyale , yeah you are right, it's how we can reproduce it. I will work on it

mohammadranjbarz commented 1 month ago

We have the same problem here https://giveth.io/project/bahar-library-a-beacon-of-hope-in-ramin-village?tab=givpower

When connected to a chain that doesn't have subgraph address, it shows today date instead of correct end of the round date

Screenshot 1403-06-01 at 1 03 27 in the afternoon
geleeroyale commented 1 month ago

But guys - is this information supposed to be:

Because then it would be ideal to just query one subgraph and cache the value until it needs an update (new round) instead of doing this for all chains with a live query that might fail due to subgraph support

mohammadranjbarz commented 1 month ago

But guys - is this information supposed to be:

  • different on chains?
  • updated often?

Because then it would be ideal to just query one subgraph and cache the value until it needs an update (new round) instead of doing this for all chains with a live query that might fail due to subgraph support

As I checked for this specific field (startTime) it's same for all smart contracts so I did the same solution in #4610 , just put the correct value as the default value, so in case it fails it would use the correct default value

geleeroyale commented 1 month ago

it persists for me 🤔 image

@geleeroyale It might be unrelated to this issue but it seems we dont have NEXT_PUBLIC_SUBGRAPH_CLASSIC in vercel Environment variables so it uses the http://167.172.97.150:8000/subgraphs/name/giveth/etc ( In the production.tsx it says to use that url if NEXT_PUBLIC_SUBGRAPH_CLASSIC not exists

  CLASSIC_CONFIG: {
      ...classic,
      chainType: ChainType.EVM,
      gasPreference: {
          // Keep it empty for automatic configuration
      },
      subgraphAddress:
          process.env.NEXT_PUBLIC_SUBGRAPH_CLASSIC ||
          'http://167.172.97.150:8000/subgraphs/name/giveth/etc',

) and because it's not a https address Chrome blocks it.

Fixed in https://github.com/Giveth/devops/issues/257

mohammadranjbarz commented 1 month ago

@laurenluz @maryjaf It's fixed and deployed on Production, you can test it now https://giveth.io/givbacks

laurenluz commented 1 month ago

better!! image

maybe @maryjaf if you can do a quick check on all chains & with wallet not connected... if that's all ok, then I think we can close this.

maryjaf commented 1 month ago

maybe @maryjaf if you can do a quick check on all chains & with wallet not connected... if that's all ok, then I think we can close this.

I've checked and it works as expected.