Giveth / analytics-dashboard

Analytics dashboard for Giveth data
https://stats.giveth.io/
GNU General Public License v3.0
23 stars 5 forks source link

track count of multisig sessions opened between two dates #10

Closed divine-comedian closed 3 weeks ago

divine-comedian commented 2 months ago

in order to track how often the multisig integration feature is being used we should find a way to track how many multisig sessions were opened between two given dates.

@CarlosQ96 knows where to find this information

ae2079 commented 1 month ago

@divine-comedian After fix the preview by Ramin, now, we can start test it via this link: https://analytics-dashboard-1uj2mh95z-givethio.vercel.app/

divine-comedian commented 1 month ago

@LatifatAbdullahi - here's how to test this issue:

  1. create or connect to an existing safe multisig on base sepolia or gnosis chain (those are the only two test networks that both Safe and Giveth support https://app.safe.global/welcome/accounts

I recommend creating a new multisig with 2/2 signers - using two addresses you control, use two separate browsers to connect with each signer (firefox / brave / chrome are all good options)

  1. Check on the vercel link to see current # of tracked multisig session connections made https://analytics-dashboard-1uj2mh95z-givethio.vercel.app/

image

  1. Follow these instructions to connect to Giveth with your multisig ---> https://docs.giveth.io/dapps/multisigs
  2. When you've connected successfully does the count of sessions go up?
  3. repeat steps 1-4 on another chain
LatifatAbdullahi commented 1 month ago

Noted.

LatifatAbdullahi commented 1 month ago

@ae2079

The Dashboard keeps throwing this error

image

Also, I would like to have a call with you when you are available please before dropping my feedback on the test

ae2079 commented 1 month ago

@ae2079

The Dashboard keeps throwing this error

image

Also, I would like to have a call with you when you are available please before dropping my feedback on the test

I will check this error with @mohammadranjbarz and I will DM you on Discord to schedule a call

ae2079 commented 1 month ago

@ae2079

The Dashboard keeps throwing this error

image

Also, I would like to have a call with you when you are available please before dropping my feedback on the test

The error is fixed now, you can start your tests with this link: https://analytics-dashboard-q4j1m7o0a-givethio.vercel.app/

divine-comedian commented 1 month ago

@LatifatAbdullahi - what is the status update of the QA?

LatifatAbdullahi commented 1 month ago

I would have to retest the task to give an update, I had to pause since bugs were still being fixed

LatifatAbdullahi commented 1 month ago

@ae2079 The Dashboard keeps throwing this error image Also, I would like to have a call with you when you are available please before dropping my feedback on the test

The error is fixed now, you can start your tests with this link: https://analytics-dashboard-q4j1m7o0a-givethio.vercel.app/

I missed this comment, thanks I will check

LatifatAbdullahi commented 1 month ago

@divine-comedian @ae2079

Using this link (https://analytics-dashboard-q4j1m7o0a-givethio.vercel.app/), this issue is fixed

image

Based on this Step " When you've connected successfully does the count of sessions go up? "

Gnosis Chain

Using a safe account created with Gnosis chain and with 2 signers, connecting successfully to the Giveth staging with each signer on chrome and mozilla does not count on the Analytics for Multisig session. The count only reflected when a transaction was done and signed by both signers on separate browsers.

image

Base Sepolia

Using a safe account created with Base Sepolia and with 2 signers, connecting successfully to the Giveth staging with each signer on chrome and mozilla does not count on the Analytics for Multisig session.

mateodaza commented 1 month ago

@divine-comedian I have a concern that I discussed with @LatifatAbdullahi I'm not entirely sure how the analytics are working but if they're being tracked on the frontend the fact that the multisig is inside an iframe could cause some unexpected issues.. I would suggest managing this from the authentication microservice in the backend if possible. I'm not sure who set this up to double check

divine-comedian commented 1 month ago

@ae2079 - that's for you, I don't have a strong opinion on what method we use to track the information, as long as it is reliable..

And to clarify from Latifat's testing - we should be tracking the moment from when a multisig session is opened - not from when a transaction is made from a multisig.

ae2079 commented 1 month ago

@divine-comedian I have a concern that I discussed with @LatifatAbdullahi I'm not entirely sure how the analytics are working but if they're being tracked on the frontend the fact that the multisig is inside an iframe could cause some unexpected issues.. I would suggest managing this from the authentication microservice in the backend if possible. I'm not sure who set this up to double check

yes, I use swieAuthMicroservice for that, and I get the data from multisigSessions repository

ae2079 commented 1 month ago

@ae2079 - that's for you, I don't have a strong opinion on what method we use to track the information, as long as it is reliable..

And to clarify from Latifat's testing - we should be tracking the moment from when a multisig session is opened - not from when a transaction is made from a multisig.

Based on the implementation, it seems there are no dependencies with donations, but I will double-check it and test it. How can I create a multisig session on staging? @divine-comedian

ae2079 commented 1 month ago

@mateodaza it seems the login issue still exists on the staging because I tried many times to sign messages in the safe wallet and after a while it didn't apply to the staging app and I am still not logged in. Screenshot 2024-07-16 234447 Screenshot 2024-07-16 234501

I gave this query from @CarlosQ96 to create a multisig session manually on the database:

INSERT INTO public.multisig_session
("safeMessageHash", "multisigAddress", "expirationDate", "createdAt", "updatedAt", "approvalExpirationDate", active, network, status)
VALUES
('0x249639e0af0157c3a53ef27565f2a6a26011ea46003b0605d8035f7516e6fefb', -- safeMessageHash
 '0x40891ce6e8574bb9118913a8a304195437f36213', -- multisigAddress
 CURRENT_DATE + INTERVAL '3 months', -- expirationDate
 CURRENT_DATE, -- createdAt
 CURRENT_DATE, -- updatedAt
 CURRENT_DATE + INTERVAL '3 months', -- approvalExpirationDate
 TRUE, -- active
 10, -- network
 'successful' -- status
);

and after executing this query, the amount of multisig sessions increased correctly: Screenshot 2024-07-17 022840

@LatifatAbdullahi I think the problem may be related to multisig sessions issue on the staging because the metrics increased for me without making any donation.

@divine-comedian For releasing this feature, we need to deploy changes on the swieAuth microservice first, and these changes did not affect other features so we can deploy them independently.

mateodaza commented 1 month ago

@mateodaza it seems the login issue still exists on the staging because I tried many times to sign messages in the safe wallet and after a while it didn't apply to the staging app and I am still not logged in.

Screenshot 2024-07-16 234447

Screenshot 2024-07-16 234501

I gave this query from @CarlosQ96 to create a multisig session manually on the database:


INSERT INTO public.multisig_session

("safeMessageHash", "multisigAddress", "expirationDate", "createdAt", "updatedAt", "approvalExpirationDate", active, network, status)

VALUES

('0x249639e0af0157c3a53ef27565f2a6a26011ea46003b0605d8035f7516e6fefb', -- safeMessageHash

 '0x40891ce6e8574bb9118913a8a304195437f36213', -- multisigAddress

 CURRENT_DATE + INTERVAL '3 months', -- expirationDate

 CURRENT_DATE, -- createdAt

 CURRENT_DATE, -- updatedAt

 CURRENT_DATE + INTERVAL '3 months', -- approvalExpirationDate

 TRUE, -- active

 10, -- network

 'successful' -- status

);

and after executing this query, the amount of multisig sessions increased correctly:

Screenshot 2024-07-17 022840

@LatifatAbdullahi I think the problem may be related to multisig sessions issue on the staging because the metrics increased for me without making any donation.

@divine-comedian For releasing this feature, we need to deploy changes on the swieAuth microservice first, and these changes did not affect other features so we can deploy them independently.

You still need to sign with your signer address every single time, according to your screenshot you still miss that step

ae2079 commented 1 month ago

@mateodaza I checked the multisig_sessions table and there was no entry for my multisig wallet address and also checked the code and saw there is no config for network ID that relates to base sepolia network, maybe this can help you to find the issue

ae2079 commented 1 month ago

@mateodaza it seems the login issue still exists on the staging because I tried many times to sign messages in the safe wallet and after a while it didn't apply to the staging app and I am still not logged in. Screenshot 2024-07-16 234447 Screenshot 2024-07-16 234501 I gave this query from @CarlosQ96 to create a multisig session manually on the database:


INSERT INTO public.multisig_session

("safeMessageHash", "multisigAddress", "expirationDate", "createdAt", "updatedAt", "approvalExpirationDate", active, network, status)

VALUES

('0x249639e0af0157c3a53ef27565f2a6a26011ea46003b0605d8035f7516e6fefb', -- safeMessageHash

 '0x40891ce6e8574bb9118913a8a304195437f36213', -- multisigAddress

 CURRENT_DATE + INTERVAL '3 months', -- expirationDate

 CURRENT_DATE, -- createdAt

 CURRENT_DATE, -- updatedAt

 CURRENT_DATE + INTERVAL '3 months', -- approvalExpirationDate

 TRUE, -- active

 10, -- network

 'successful' -- status

);

and after executing this query, the amount of multisig sessions increased correctly: Screenshot 2024-07-17 022840 @LatifatAbdullahi I think the problem may be related to multisig sessions issue on the staging because the metrics increased for me without making any donation. @divine-comedian For releasing this feature, we need to deploy changes on the swieAuth microservice first, and these changes did not affect other features so we can deploy them independently.

You still need to sign with your signer address every single time, according to your screenshot you still miss that step

I think I do that, let me do it again to ensure that

ae2079 commented 1 month ago

first I open the app from the safe wallet webpage, then I click on my MyAccount, and this pop-up is shown: Screenshot 2024-07-16 234447

then I click on sign in button and select a 1 week duration for example: Screenshot 2024-07-17 025239

after clicking on 'let's do it' button, I have to sign this message with my Metamask wallet: Screenshot 2024-07-17 025254

after that, I redirected to the safe message signing page and signed it with my Metamast again: Screenshot 2024-07-17 030031

Screenshot 2024-07-17 030045

after signing it, I was redirected to this page again: Screenshot 2024-07-17 030207

and after that, when I closed the pop-up and selected myAccount again, I faced this pop-up again (without reloading the page): Screenshot 2024-07-17 025334

@mateodaza if I missed any steps, let me know what should I exactly do, thanks

mateodaza commented 1 month ago

first I open the app from the safe wallet webpage, then I click on my MyAccount, and this pop-up is shown:

Screenshot 2024-07-16 234447

then I click on sign in button and select a 1 week duration for example:

Screenshot 2024-07-17 025239

after clicking on 'let's do it' button, I have to sign this message with my Metamask wallet:

Screenshot 2024-07-17 025254

after that, I redirected to the safe message signing page and signed it with my Metamast again:

Screenshot 2024-07-17 030031

Screenshot 2024-07-17 030045

after signing it, I was redirected to this page again:

Screenshot 2024-07-17 030207

and after that, when I closed the pop-up and selected myAccount again, I faced this pop-up again (without reloading the page):

Screenshot 2024-07-17 025334

@mateodaza if I missed any steps, let me know what should I exactly do, thanks

Can you please test it with a multisig of 2 signers at least? - there's an edge case for 1 signer multisigs that we haven't tackled yet

ae2079 commented 1 month ago

first I open the app from the safe wallet webpage, then I click on my MyAccount, and this pop-up is shown: Screenshot 2024-07-16 234447 then I click on sign in button and select a 1 week duration for example: Screenshot 2024-07-17 025239 after clicking on 'let's do it' button, I have to sign this message with my Metamask wallet: Screenshot 2024-07-17 025254 after that, I redirected to the safe message signing page and signed it with my Metamast again: Screenshot 2024-07-17 030031 Screenshot 2024-07-17 030045 after signing it, I was redirected to this page again: Screenshot 2024-07-17 030207 and after that, when I closed the pop-up and selected myAccount again, I faced this pop-up again (without reloading the page): Screenshot 2024-07-17 025334 @mateodaza if I missed any steps, let me know what should I exactly do, thanks

Can you please test it with a multisig of 2 signers at least? - there's an edge case for 1 signer multisigs that we haven't tackled yet

Oh, ok, I'll do that

ae2079 commented 1 month ago

@LatifatAbdullahi I signed in using a safe account with two signers in the gnosis chain and without any donations, the metric increased: Screenshot 2024-07-17 035115

Screenshot 2024-07-17 035020

I tried to create a new safe wallet with two singers on base sepolia, but it seems there are some issues(maybe because it is a test net) with the help of @mateodaza, I created a wallet and tested on the gnosis chain

FYI @divine-comedian

ae2079 commented 1 month ago

@divine-comedian I created two branches for releasing this feature when you approved it: for the back-end: https://github.com/Giveth/SiweAuthMicroservice/pull/29 (I think @CarlosQ96 should deploy this service) for the front-end: https://github.com/Giveth/analytics-dashboard/pull/23 (we should merge it after the backend deployed)

divine-comedian commented 3 weeks ago

looks like this all merged on production! great