Skip to content

bug: auto-withdraw settings save uses a stale closure and can silently revert user changes #276

Closed

Description

@Austinaminu2

Problem

`addWithdrawalHistory` (`hooks/use-auto-withdraw.ts`, lines 79-92) updates React state via a functional updater, but calls `saveSettings(stream.id, {...settings, ...})` using the stale closed-over `settings` (lines 86-89) instead of the updated value.

Location

`hooks/use-auto-withdraw.ts:79-92`

Impact

A settings change made between renders can be silently reverted in localStorage when a withdrawal history entry is added shortly after, with no indication anything went wrong.

Suggested fix

Persist settings via the latest value (e.g. a ref updated alongside state, or restructure so save always reads current state) rather than a stale closure.

Activity

  1. goodness-cpu commented on Jul 23, 2026

    @goodness-cpu

    @goodness-cpu has applied to work on this issue as part of the Stellar Wave Program's 7th wave.

    Hello Maintainer, I can fix this issue.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @goodness-cpu to this issue.

  2. brightfootlimited-collab commented on Jul 25, 2026

    @brightfootlimited-collab
    Contributor

    @brightfootlimited-collab has applied to work on this issue as part of the Stellar Wave Program's 7th wave.

    "I'm interested in this task. With my background in solving similar issues, I'm confident I can complete it efficiently and to a high standard

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @brightfootlimited-collab to this issue.

  3. drips-wave commented on Jul 25, 2026

    @drips-wave

    Congratulations, @brightfootlimited-collab! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on July 30, 2026.

    🧑‍💻 @brightfootlimited-collab: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  4. added a commit that references this issue on Jul 26, 2026
    81a1068
  5. grantfox-oss commented on Jul 26, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox as part of the Official Campaign | FWC26 campaign!

    @brightfootlimited-collab's PR #411 was approved and merged by @Austinaminu2.

    🏆 @brightfootlimited-collab: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (156 total points). Track your full progress on GrantFox.

    👏 Great work, @brightfootlimited-collab! Keep contributing to FlowwStar.

  6. drips-wave commented on Jul 26, 2026

    @drips-wave

    This issue has been completed by @brightfootlimited-collab as part of the Stellar Wave Program's 7th Wave 🥳

    😎 @brightfootlimited-collab: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingfrontendNext.js frontend

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions