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: fix empty voting period being overriden #1014

Merged
merged 14 commits into from
Dec 9, 2024

Conversation

wa0x6e
Copy link
Contributor

@wa0x6e wa0x6e commented Dec 3, 2024

Summary

Closes: #1012
Toward https://github.com/snapshot-labs/workflow/issues/282

This PR fix an issue where the voting period is saved as empty for offchain spaces, but shows as 7 days on the UI.

Issue was fixed by allowing 0 as voting period value (which means no default enforcing, and up to the proposer), with a fallback to 3 days (like on v1)

How to test

  1. Go to an offchain space settings
  2. Save the voting period as 0
  3. It saves as 0 (previously, will always show 7 instead of 0)
  4. Go to the Editor
  5. Proposal end time should be set to 3 days after start

@wa0x6e wa0x6e force-pushed the fix-allow-null-voting-period-for-offchain-spaces branch from cf51c09 to 6b50137 Compare December 3, 2024 14:36
@wa0x6e wa0x6e requested review from ChaituVR and Sekhmet December 4, 2024 10:01
Copy link
Member

@Sekhmet Sekhmet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs rebase now to account for created param.

@wa0x6e wa0x6e force-pushed the fix-allow-null-voting-period-for-offchain-spaces branch from e656373 to c7bb3dc Compare December 5, 2024 14:59
@wa0x6e wa0x6e requested a review from Sekhmet December 5, 2024 15:07
@wa0x6e
Copy link
Contributor Author

wa0x6e commented Dec 5, 2024

With this fix, we got a minor behavior change:

The proposal created and start date are now set on Editor page load, and not on on form submit.

As filling the form may take time, the creation and start date may be a few minutes behind now (which is still valid, and accepted by sequencer).

On the opposite, the dates shown on the Editor timeline are now the correct dates sent to the proposal.

EDIT: not the case anymore

@Sekhmet
Copy link
Member

Sekhmet commented Dec 5, 2024

With this fix, we got a minor behavior change

To me it's not expected behavior, why does it work this way?

Can we instead, same as before submit timestamp at the time of submit and for Editor UI make timeline reactive and update it on the fly using useNow or something similar? Or is it not possible for some reason?

@wa0x6e
Copy link
Contributor Author

wa0x6e commented Dec 6, 2024

With this fix, we got a minor behavior change

To me it's not expected behavior, why does it work this way?

Can we instead, same as before submit timestamp at the time of submit and for Editor UI make timeline reactive and update it on the fly using useNow or something similar? Or is it not possible for some reason?

Implemented using reactive timestamp.

apps/ui/src/components/ProposalTimeline.vue Outdated Show resolved Hide resolved
apps/ui/src/views/Space/Editor.vue Outdated Show resolved Hide resolved
@Sekhmet Sekhmet merged commit 3eeda28 into master Dec 9, 2024
4 checks passed
@Sekhmet Sekhmet deleted the fix-allow-null-voting-period-for-offchain-spaces branch December 9, 2024 14:28
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.

bug: offchain space voting period default to 7 days when null
2 participants