fix: show completed stack as Finished instead of Not started - #162
Open
franrolotti wants to merge 1 commit into
Open
fix: show completed stack as Finished instead of Not started#162franrolotti wants to merge 1 commit into
franrolotti wants to merge 1 commit into
Conversation
When the last member claims, the contract sets isActive=false, and circleState() has no terminal completed value, so a cleanly finished circle falls through to NotStarted. The frontend mapped that to 'pending-start', showing 'Not started' and re-enabling the Start button. Distinguish the two in getUserCircleStatus via effectiveCircleStartTime, which is only non-zero once the circle has actually started: NotStarted with a start time set means finished, not pending start. Frontend-only mitigation. The underlying contract issue (circleState() lacking a terminal state, and start() accepting a restart of a completed circle) still needs a redeploy and is tracked separately. Refs #160
✅ Deploy Preview for app-stacks ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #160 (frontend mitigation).
Problem
When a stack completes successfully (all members deposited and claimed), the UI showed "Not started" and re-enabled the Start button.
The contract's
circleState()has no terminal "completed" value: once the last member claims,_withdrawsetsisActive = false, so a finished circle is neither decommissioned nor active and falls through toNotStarted. The frontend mappedNotStartedstraight topending-start(which drives the "Not started" label and the Start button) before the unreachablefinishedbranch could run.Fix
In
getUserCircleStatus, split theNotStartedbranch oneffectiveCircleStartTime, which is only non-zero once the circle has actually been started.NotStartedwith a start time set is a completed circle → returnfinished; otherwise it's genuinely pending start. This corrects the label and hides the Start button (gated onpending-start).Scope / follow-up
This is a frontend-only mitigation and ships without a redeploy. We should do changes in the contracts as
circleState()needs a real terminal state for a completed circle.start()only checksisActive, so it will still accept a restart of a completed circle if called directly.