Skip to content

Auto-upgrade misses updates when just-upgraded-from marker is stale #515

Closed

Description

@anshahl1

Bug

When a just-upgraded-from marker file persists across sessions, gstack-update-check short-circuits and never fetches the remote VERSION — even if the remote has moved far ahead.

Reproduction

  1. gstack auto-upgrades from 0.9.3.0 → 0.9.4.0 (writes ~/.gstack/just-upgraded-from with 0.9.3.0)
  2. That session ends before the marker is consumed (or the marker persists for another reason)
  3. 42 commits land on origin/main, pushing VERSION to 0.11.21.0
  4. New session starts → gstack-update-check runs
  5. Step 2 (line 112-122) finds the marker, outputs JUST_UPGRADED 0.9.3.0 0.9.4.0, writes UP_TO_DATE 0.9.4.0 to cache, and exits immediately
  6. Step 4 (remote fetch) never runs
  7. User stays on 0.9.4.0, missing 42 commits

Root Cause

gstack-update-check lines 112-122:

if [ -f "$MARKER_FILE" ]; then
  OLD="$(cat "$MARKER_FILE" 2>/dev/null | tr -d '[:space:]')"
  rm -f "$MARKER_FILE"
  rm -f "$SNOOZE_FILE"
  mkdir -p "$STATE_DIR"
  echo "UP_TO_DATE $LOCAL" > "$CACHE_FILE"
  if [ -n "$OLD" ]; then
    echo "JUST_UPGRADED $OLD $LOCAL"
  fi
  exit 0  # ← Never checks remote
fi

The script assumes "just upgraded = up to date" which isn't true if the remote advanced between the upgrade and the next session.

Suggested Fix

After consuming the marker, still do the remote VERSION fetch (or at minimum, don't write UP_TO_DATE to cache — let it fall through to Step 4):

if [ -f "$MARKER_FILE" ]; then
  OLD="$(cat "$MARKER_FILE" 2>/dev/null | tr -d '[:space:]')"
  rm -f "$MARKER_FILE"
  rm -f "$SNOOZE_FILE"
  if [ -n "$OLD" ]; then
    echo "JUST_UPGRADED $OLD $LOCAL"
  fi
  # Don't exit — fall through to remote check in case
  # more updates landed since the upgrade
fi

Environment

  • gstack v0.9.4.0 → v0.11.21.0 (42 commits missed)
  • macOS Darwin 24.6.0
  • auto_upgrade: true in ~/.gstack/config.yaml
  • Global git install at ~/.claude/skills/gstack/

Workaround

Run /gstack-upgrade manually or gstack-update-check --force to bust the cache.

Activity

  1. added a commit that references this issue on Mar 26, 2026
    3045909
  2. added a commit that references this issue on Mar 27, 2026
    b343ba2
  3. added a commit that references this issue on Mar 27, 2026
    3525c25
  4. added a commit that references this issue on Mar 29, 2026
    6e48660
  5. added a commit that references this issue on Mar 29, 2026
    2b107d9
  6. added a commit that references this issue on May 30, 2026
    c6f397b
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