Skip to content

[BUG REPORT] Auto-save timer goes negative and never triggers while a song is playing (v3.12.0-rc.2) #605

Open

Description

@Joining2843

English Edition:
While a song is playing, the Auto-save timer counts down past zero into negative values and never fires — no auto-save is performed. As soon as playback is paused/stopped, the timer behaves normally again and auto-save works.

Steps to reproduce:

  1. Open Settings, enable Auto-save, set the interval to 1 minute.
  2. Open a song and press Play.
  3. Observe: the remaining time keeps decreasing past 0 into negative values, and the project is never auto-saved (the file's modified timestamp does not change).
  4. Pause playback — the timer recovers and auto-save fires normally.

Expected behavior:
The auto-save countdown should keep counting in real time and trigger a save at the configured interval, regardless of playback state. It should never go negative.

Possible cause:
The auto-save timer appears to be coupled to the playback clock/tick. When playback is running, the timer is decremented faster than real time and underflows into negatives, so the "time reached 0" condition is never met and the save callback never runs. This looks like a regression of the issue fixed in v3.11.0-beta.3 ("Fixed auto-save ticking down into negatives…"). It seems to have returned in 3.12.0-rc.2.

Environment:

  • OpenNBS version: 3.12.0-rc.2
  • OS: Windows 11
  • .NET version: 13.0
  • Repro rate: always

Additional context:
No error dialog appears — the timer just silently goes negative and no save happens. Attached: a screenshot of the auto-save timer showing a negative value during playback, and the project file's modified timestamp not updating.

====================

中文版:
在播放乐曲时,自动保存计时器会从 0 继续向下递减为负数,并且永远不会触发保存——不会执行任何自动保存操作。一旦暂停/停止播放,计时器就恢复正常,自动保存也随之正常工作。

复现步骤:

  1. 打开设置,启用自动保存,将间隔设为 1 分钟。
  2. 打开一首乐曲并按下播放。
  3. 观察:剩余时间持续递减越过 0 变为负数,且工程从未被自动保存(文件"修改日期"不变)。
  4. 暂停播放后,计时器恢复,自动保存正常触发。

预期行为:
自动保存倒计时应按真实时间持续计时,并在达到设定间隔时触发保存,与播放状态无关。它不应变为负数。

可能的原因:
自动保存计时器似乎与播放时钟/节拍绑定。播放运行时,计时器被以快于真实时间的速度递减,导致下溢为负数,因此"时间归零"的判断永远不会成立,保存回调也永远不执行。这看起来是 v3.11.0-beta.3 中已修复问题("Fixed auto-save ticking down into negatives…")的回归,在 3.12.0-rc.2 中再次出现。

环境:

  • OpenNBS 版本:3.12.0-rc.2
  • 操作系统:Windows 11
  • .NET 版本:13.0
  • 复现率:必现

补充说明:
没有出现任何错误提示——计时器只是静默地变为负数,且不发生保存。附件:播放时自动保存计时器显示负数的截图,以及工程文件"修改日期"未更新的截图。

屏幕截图 2026-11-22 151934 屏幕截图 2026-11-22 152113 屏幕截图 2026-11-22 152308 屏幕截图 2026-11-22 152617

Activity

  1. OctoFlareDev commented on Nov 22, 2026

    @OctoFlareDev
    Collaborator

    This is intended behavior, it should never save during playback since nbs is singlethreaded, it will cause lag.

  2. OctoFlareDev commented on Nov 22, 2026

    @OctoFlareDev
    Collaborator

    but negative value is a cosmetic regression tho

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions