GoodDollar / GoodCollective

Monorepo for GoodCollective (Segmented UBI and Direct Payments Pool)
MIT License
3 stars 1 forks source link

[Bug] Stop donation / Cancel subscription not showing on Collective page. #136

Closed decentralauren closed 5 months ago

decentralauren commented 8 months ago

Screenshot 2024-01-30 at 4 18 34 PM Subscription does not display on Collective screen.

I have a 5-day subscription streaming G$, and do not see the ability to cancel my subscription on the Collective screen.

The out-standing subscription may be the cause of the error in ticket 135

decentralauren commented 8 months ago

OK the option DID appear, but many minutes after the donation was made. @krisbitney should we expect this kind of lag? If so we should adjust the language in the post-donation modal to say "may take a while to show up" etc. cc @patpedrosa

krisbitney commented 8 months ago

OK the option DID appear, but many minutes after the donation was made. @krisbitney should we expect this kind of lag? If so we should adjust the language in the post-donation modal to say "may take a while to show up" etc. cc @patpedrosa

I added a performance optimization in this PR: https://github.com/GoodDollar/GoodCollective/pull/137

The delay depends on multiple factors.

I made it so the app checks more often if there is any new data in the Subgraph for this specific thing.

vldkhh commented 8 months ago

verified

L03TJ3 commented 8 months ago

@vldkhh this was not merged yet, so needs re-qa'd. if it works for you its for PR to go over it again.

krisbitney commented 8 months ago

This is fixed in https://github.com/GoodDollar/GoodCollective/pull/137

vldkhh commented 8 months ago

@decentralauren @L03TJ3 see no issues with that

https://github.com/GoodDollar/GoodCollective/assets/107620432/a5d26b7b-9a52-4d74-b374-930b233f3862

vldkhh commented 8 months ago

@decentralauren close if you agree

decentralauren commented 8 months ago

Works as expected with G$ stream

I am unable to test with other currencies as I receive the "UNPREDICTABLE_GAS_LIMIT" error when donating. @vldkhh were you able to test with non-G$?

patpedrosa commented 8 months ago

I've noticed that there's a small delay in showing on the profile & collective pages that the stream has stopped, which is not good UX. We're also missing a modal for confirming the donation has stopped. I have added it to our list for sprint 8.

vldkhh commented 8 months ago

@krisbitney @decentralauren I'm not able to stop my donation after using Celo image

krisbitney commented 8 months ago

@vldkhh Whether you use Celo or not is unrelated to stopping the donation, but I think I may have found the issue. I think this PR should fix it: https://github.com/GoodDollar/GoodCollective/pull/178

vldkhh commented 8 months ago

@krisbitney checked on the deployment above, and it is still reproducing + fetchfullnames info logs keep increasing. could you double check it?

https://github.com/GoodDollar/GoodCollective/assets/107620432/193aa396-5b69-4ec8-9c56-a926a883393c

krisbitney commented 8 months ago

@krisbitney checked on the deployment above, and it is still reproducing + fetchfullnames info logs keep increasing. could you double check it?

1BACF17F-5838-4C87-8893-8FC6B4E207BB.MP4

The log isn't something I added. I'll leave that to your team.

If the stop donation error is still reproducing, it's a smart contract issue. The front end only supplies the inputs to the smart contract calls. The deleteFlow method is very simple.

const tx = await sdk.deleteFlow(signer, collective, '0');

I double checked and confirmed the correct collective address is being passed in. The other parameters are a constant and the signer.

@sirpy

L03TJ3 commented 8 months ago

Ye that log is mine. I am trying to figure out what makes the fetching of transactions end up in an endless cycle @vldkhh

@krisbitney not asking you to fix it but do you have any idea what can cause this? It seems to be the fetch query for donations, but I haven't figured out yet why?

krisbitney commented 7 months ago

Ye that log is mine. I am trying to figure out what makes the fetching of transactions end up in an endless cycle @vldkhh

@krisbitney not asking you to fix it but do you have any idea what can cause this? It seems to be the fetch query for donations, but I haven't figured out yet why?

No, I didn't realize it was happening. I'll take a look.

krisbitney commented 7 months ago

@L03TJ3 I don't think useFetchFullNames is being called endlessly due to repeated fetching transactions. The useMemo hook that depends on the donations and claims arrays isn't repeatedly called, suggesting the same donations and claims arrays are used.

This TODO comment is likely related to the poll interval having been 1 second:

  //todo-fix: donations is called endlessly
  const donations: Transaction[] | undefined = useRecentDonations(collective, maxN, donationsPollInterval);

The useRecentTransactions hook isn't endlessly called. I will update as I learn more.

L03TJ3 commented 7 months ago

@krisbitney

place a log in supporttranasctionlistitem and watch console.

that is what I traced back to useRecentTransactions.

krisbitney commented 7 months ago

@krisbitney

place a log in supporttranasctionlistitem and watch console.

that is what I traced back to useRecentTransactions.

I see it. I think the issue might be the flowing balance. It should probably be isolated in its own component, kind of like the FlowingBalanceRowItem component.

L03TJ3 commented 7 months ago

@krisbitney isn't this likely to happen to any component where we try and merge the transactions?

krisbitney commented 7 months ago

@krisbitney isn't this likely to happen to any component where we try and merge the transactions?

I think it should only affect the SupoprtTransactionListItem and its children

krisbitney commented 7 months ago

I confirmed that the issue is the flowing balances. I did so by adjusting the flow update frequency to see if that affected the console logs. Now I'm just thinking about how to refactor the transaction list items.

krisbitney commented 7 months ago

@L03TJ3 A fix is in this PR: https://github.com/GoodDollar/GoodCollective/pull/180

decentralauren commented 7 months ago

@vldkhh @L03TJ3 can you confirm the fix / retest so we can close?

github-actions[bot] commented 5 months ago

Stale issue message

decentralauren commented 5 months ago

@vldkhh please retest :)

vldkhh commented 5 months ago

@decentralauren works for me Snag_2fc5e90e