Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/reset vote selection #4480

Merged
merged 1 commit into from
Nov 2, 2023
Merged

Fix/reset vote selection #4480

merged 1 commit into from
Nov 2, 2023

Conversation

agualis
Copy link
Collaborator

@agualis agualis commented Oct 31, 2023

Description

The multivoting request was not being recreated when the on user account change.

The underlying code is probably too complex.

The main idea is that the first time we load the voting list decorated with votes, we also load an in memory votingRequest that is shared across the voting pages (list and forms) to store the current selection (pools + votes) of the user.
The issue was that, once the user account was changed the vue-queries were being reloaded but the votingRequest didn’t. We need watchers to know how to reset/update that votingRequest and that’s the complex part but I made them work in all scenarios.

If I had more time I would try to simplify the logic around this watchers but I think it is ok like it is now.

The key is that when we detect that the user account changed, we reset the voting list query and the votingRequest to trigger a complete reload.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency changes
  • Code refactor / cleanup
  • Documentation or wording changes
  • Other

How should this be tested?

Please provide instructions so we can test. Please also list any relevant details for your test configuration.

  • Test A
  • Test B

Visual context

updateAccount.mp4

Checklist:

  • I have performed a self-review of my own code
  • I have requested at least 1 review (If the PR is significant enough, use best judgement here)
  • I have commented my code where relevant, particularly in hard-to-understand areas
  • If package-lock.json has changes, it was intentional.
  • The base of this PR is master if hotfix, develop if not

Copy link

vercel bot commented Oct 31, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
beta-app-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 31, 2023 4:06pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
app-v2 ⬜️ Ignored (Inspect) Oct 31, 2023 4:06pm

@agualis agualis merged commit d3fe1e2 into master Nov 2, 2023
6 checks passed
@agualis agualis deleted the fix/reset-vote-selection branch November 2, 2023 09:37
garethfuller added a commit that referenced this pull request Nov 3, 2023
* chore: Add RDNT-WETH pool to ethereum allowlist

* fix: temporary hide optimism

* 1.130.1

* 1.130.2

* fix: optimism deprecated pools list

* 1.130.3

* update weekly gauges (#4477)

* update weekly gauges

* add zkevm pool

* 1.130.4

* feat: add pool composable stable factory address on zkevm

* 1.130.5

* new gauges

* 1.130.6

* chore: Add 50WETH-50DAI pool to base allowlist (#4486)

Co-authored-by: balopco <balopco@users.noreply.github.com>

* 1.130.7

* chore: Add 50USDbC-50axlUSDC pool to base allowlist (#4483)

Co-authored-by: balopco <balopco@users.noreply.github.com>
Co-authored-by: Alberto Gualis <alberto@balancer.finance>

* chore: Add 50wstETH-50MaticX pool to polygon allowlist (#4482)

Co-authored-by: balopco <balopco@users.noreply.github.com>

* 1.130.8

* chore: Add 50WETH-50USDbC pool to base allowlist (#4484)

Co-authored-by: balopco <balopco@users.noreply.github.com>
Co-authored-by: Alberto Gualis <alberto@balancer.finance>

* 1.130.9

* feat: Enable OP (#4479)

* chore: Enable OP in UI

* chore: Add CSP warning

* 1.130.10

* Fix: reload multivoting request on account change (#4480)

* 1.130.11

* chore: Add 50WETH-50USDbC pool to base allowlist (#4500)

Co-authored-by: balopco <balopco@users.noreply.github.com>

* 1.130.12

* adding zkevm pools to whitelist

* 1.130.13

* chore: Add 80WBTC-20USDC pool to arbitrum allowlist (#4505)

Co-authored-by: balopco <balopco@users.noreply.github.com>

* 1.130.14

* chore: Remove tally from wallet options

* chore: Fix WC aspect ratio

---------

Co-authored-by: balopco <balopco@users.noreply.github.com>
Co-authored-by: Anastasios <anastas3993@gmail.com>
Co-authored-by: Automated Version Bump <gh-action-bump-version@users.noreply.github.com>
Co-authored-by: Tritium <11885129+Tritium-VLK@users.noreply.github.com>
Co-authored-by: ZeKraken <79888567+zekraken-bot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alberto Gualis <alberto@balancer.finance>
garethfuller added a commit that referenced this pull request Nov 6, 2023
* chore: Add RDNT-WETH pool to ethereum allowlist

* fix: temporary hide optimism

* 1.130.1

* 1.130.2

* fix: optimism deprecated pools list

* 1.130.3

* update weekly gauges (#4477)

* update weekly gauges

* add zkevm pool

* 1.130.4

* feat: add pool composable stable factory address on zkevm

* 1.130.5

* new gauges

* 1.130.6

* chore: Add 50WETH-50DAI pool to base allowlist (#4486)

Co-authored-by: balopco <balopco@users.noreply.github.com>

* 1.130.7

* chore: Add 50USDbC-50axlUSDC pool to base allowlist (#4483)

Co-authored-by: balopco <balopco@users.noreply.github.com>
Co-authored-by: Alberto Gualis <alberto@balancer.finance>

* chore: Add 50wstETH-50MaticX pool to polygon allowlist (#4482)

Co-authored-by: balopco <balopco@users.noreply.github.com>

* 1.130.8

* chore: Add 50WETH-50USDbC pool to base allowlist (#4484)

Co-authored-by: balopco <balopco@users.noreply.github.com>
Co-authored-by: Alberto Gualis <alberto@balancer.finance>

* 1.130.9

* feat: Enable OP (#4479)

* chore: Enable OP in UI

* chore: Add CSP warning

* 1.130.10

* Fix: reload multivoting request on account change (#4480)

* 1.130.11

* chore: Add 50WETH-50USDbC pool to base allowlist (#4500)

Co-authored-by: balopco <balopco@users.noreply.github.com>

* 1.130.12

* adding zkevm pools to whitelist

* 1.130.13

* chore: Add 80WBTC-20USDC pool to arbitrum allowlist (#4505)

Co-authored-by: balopco <balopco@users.noreply.github.com>

* 1.130.14

* chore: Update wallet connect modal (#4507)

* chore: Remove tally from wallet options

* chore: Fix WC aspect ratio

* 1.130.15

* chore: Add 33BAL-33USDC-33USDbC pool to base allowlist (#4509)

Co-authored-by: balopco <balopco@users.noreply.github.com>

* 1.130.16

* chore: Add 50WBTC-50LINK pool to arbitrum allowlist (#4506)

Co-authored-by: balopco <balopco@users.noreply.github.com>

* 1.130.17

* chore: Add 50WETH-50USDbC pool to base allowlist (#4490)

Co-authored-by: balopco <balopco@users.noreply.github.com>
Co-authored-by: Gareth Fuller <gareth.a.f@gmail.com>

* 1.130.18

* chore: Add 50USDbC-50STG pool to base allowlist (#4504)

Co-authored-by: balopco <balopco@users.noreply.github.com>
Co-authored-by: Gareth Fuller <gareth.a.f@gmail.com>

* 1.130.19

* chore: Fix Gyro pools on zkevm

---------

Co-authored-by: balopco <balopco@users.noreply.github.com>
Co-authored-by: Anastasios <anastas3993@gmail.com>
Co-authored-by: Automated Version Bump <gh-action-bump-version@users.noreply.github.com>
Co-authored-by: Tritium <11885129+Tritium-VLK@users.noreply.github.com>
Co-authored-by: ZeKraken <79888567+zekraken-bot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alberto Gualis <alberto@balancer.finance>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants